Skip to content

Commit 5edf5e1

Browse files
sideshowbarkerhsivonen
authored andcommitted
Make EncodingTester usable in testing parsed state
This change updates EncodingTester to make it test the result for cases when the expected character encoding is not limited to what can be determined by checking only the first 1024 bytes of the input stream. Otherwise, without this change, EncodingTester is limited to only being useful for testing the output of the meta prescan.
1 parent 54dd1e0 commit 5edf5e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test-src/nu/validator/htmlparser/test/EncodingTester.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class EncodingTester {
3838

3939
private static int exitStatus = 0;
4040

41+
protected static int SNIFFING_LIMIT = 16384;
42+
4143
private final InputStream aggregateStream;
4244

4345
private final StringBuilder builder = new StringBuilder();
@@ -62,7 +64,7 @@ private boolean runTest() throws IOException, SAXException {
6264
}
6365
UntilHashInputStream stream = new UntilHashInputStream(aggregateStream);
6466
HtmlInputStreamReader reader = new HtmlInputStreamReader(stream, null,
65-
null, null, Heuristics.NONE);
67+
null, null, Heuristics.NONE, SNIFFING_LIMIT);
6668
Charset charset = reader.getCharset();
6769
stream.close();
6870
if (skipLabel()) {

0 commit comments

Comments
 (0)