Skip to content

Commit

Permalink
Set dontSwallowBom for testharness
Browse files Browse the repository at this point in the history
This change causes the dontSwallowBom() method to be called for the
driver instance used in TokenizerTester. That causes any BOM at the
beginning of test input to not be swallowed but instead preserved.

Otherwise, without this change, the following html5lib-tests case fails:

* https://github.com/html5lib/html5lib-tests/blob/master/tokenizer/domjs.test#L197

Relates to #35
  • Loading branch information
sideshowbarker committed Aug 21, 2020
1 parent 325abc3 commit 98fd522
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test-src/nu/validator/htmlparser/test/TokenizerTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private TokenizerTester(InputStream stream) throws TokenStreamException,
driver.setNamePolicy(XmlViolationPolicy.ALLOW);
driver.setXmlnsPolicy(XmlViolationPolicy.ALLOW);
driver.setErrorHandler(tokenHandler);
driver.dontSwallowBom();
writer = new OutputStreamWriter(System.out, "UTF-8");
JSONParser jsonParser = new JSONParser(new InputStreamReader(stream,
"UTF-8"));
Expand Down

0 comments on commit 98fd522

Please sign in to comment.