diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-05-06 19:33:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 19:33:17 -0400 |
commit | f7df6254d6f71d5331b000dcbd27271bd2c3006f (patch) | |
tree | 99ec2aa66349ba07d4379f31ee3be762235249dd /test/test-dom-text-scanner.js | |
parent | bb2d9501afc0e406b0dacf5675cd90985238be98 (diff) |
Dom text scanner fixes (#505)
* Fix test case
* Add test-dom-text-scanner
* Ensure that DOMTextScanner._node never becomes null
* Add remainder
Diffstat (limited to 'test/test-dom-text-scanner.js')
-rw-r--r-- | test/test-dom-text-scanner.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test-dom-text-scanner.js b/test/test-dom-text-scanner.js index 41d6e307..7374ff87 100644 --- a/test/test-dom-text-scanner.js +++ b/test/test-dom-text-scanner.js @@ -103,7 +103,8 @@ async function testDomTextScanner(dom, {DOMTextScanner}) { expected: { node: expectedNode, offset: expectedOffset, - content: expectedContent + content: expectedContent, + remainder: expectedRemainder } } = testDataItem; @@ -115,10 +116,11 @@ async function testDomTextScanner(dom, {DOMTextScanner}) { const scanner = new DOMTextScanner(node, offset, forcePreserveWhitespace, generateLayoutContent); scanner.seek(length); - const {node: actualNode1, offset: actualOffset1, content: actualContent1} = scanner; + const {node: actualNode1, offset: actualOffset1, content: actualContent1, remainder: actualRemainder1} = scanner; assert.strictEqual(actualContent1, expectedContent); assert.strictEqual(actualOffset1, expectedOffset); assert.strictEqual(actualNode1, expectedNode); + assert.strictEqual(actualRemainder1, expectedRemainder || 0); } // Substring tests |