Skip to content

Commit ccb879c

Browse files
Make the test harness skip non-test files
This change makes TreeTester and EncodingTester skip all files except *.dat files, and makes TokenizerTester skip all files except *.test files.
1 parent c72ba18 commit ccb879c

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ private boolean skipLabel() throws IOException {
114114
*/
115115
public static void main(String[] args) throws IOException, SAXException {
116116
for (int i = 0; i < args.length; i++) {
117+
if (!args[i].endsWith(".dat")) {
118+
continue;
119+
}
117120
EncodingTester tester = new EncodingTester(new FileInputStream(
118121
args[i]));
119122
tester.runTests();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ private void runTestInner(String inputString, JSONArray expectedTokens,
212212
public static void main(String[] args) throws TokenStreamException,
213213
RecognitionException, SAXException, IOException {
214214
for (int i = 0; i < args.length; i++) {
215+
if (!args[i].endsWith(".test")) {
216+
continue;
217+
}
215218
TokenizerTester tester = new TokenizerTester(new FileInputStream(
216219
args[i]));
217220
tester.runTests();

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ private boolean skipLabel() throws IOException {
263263
*/
264264
public static void main(String[] args) throws Throwable {
265265
for (int i = 0; i < args.length; i++) {
266+
if (!args[i].endsWith(".dat")) {
267+
continue;
268+
}
266269
TreeTester tester = new TreeTester(new FileInputStream(args[i]));
267270
tester.runTests();
268271
}

0 commit comments

Comments
 (0)