libgit2/tests/resources/userdiff/expected/nodriver/diff.javascript
Russell Belfer 082e82dba5 Update Javascript userdiff driver and tests
Writing a sample Javascript driver pointed out some extra
whitespace handling that needed to be done in the diff driver.
This adds some tests with some sample javascript code that I
pulled off of GitHub just to see what would happen.  Also, to
clean up the userdiff test data, I did a "git gc" and packed
up the test objects.
2014-01-27 11:45:06 -08:00

41 lines
1.2 KiB
JavaScript

diff --git a/files/file.javascript b/files/file.javascript
index b9f1286..7cd3c5a 100644
--- a/files/file.javascript
+++ b/files/file.javascript
@@ -16,3 +16,4 @@
var client = docElem['clientHeight'],
- inner = window['innerHeight'];
+ inner = window['innerHeight'],
+ sample = window['otherProperty'];
@@ -27,3 +28,3 @@
if (!isNaN(el.offsetTop)) {
- offsetTop += el.offsetTop;
+ offsetTop += el.offsetTop + 1;
}
@@ -43,8 +44,7 @@
viewed = scrolled + getViewportH(),
- elH = el.offsetHeight,
elTop = getOffset(el).top,
- elBottom = elTop + elH,
+ elBottom = elTop + el.offsetHeight,
h = h || 0;
- return (elTop + elH * h) <= viewed && (elBottom) >= scrolled;
+ return (elTop + el.offsetHeight * h) <= viewed && (elBottom) >= scrolled;
}
@@ -60,4 +60,2 @@
- // Initialize all scrollreveals, triggering all
- // reveals on visible elements.
this.elems.forEach(function (el, i) {
@@ -71,3 +69,3 @@
self._scrollPage();
- }, 60);
+ }, 61);
}
@@ -101,2 +99,3 @@
this.scrolled = false;
+ this.tested = true;
},