99import java .util .stream .Stream ;
1010import liquidjava .api .CommandLineLauncher ;
1111import liquidjava .errors .ErrorEmitter ;
12+
13+ import org .junit .Test ;
1214import org .junit .jupiter .params .ParameterizedTest ;
1315import org .junit .jupiter .params .provider .MethodSource ;
1416
@@ -27,7 +29,7 @@ public void testFile(final Path filePath) {
2729 String fileName = filePath .getFileName ().toString ();
2830
2931 // 1. Run the verifier on the file or package
30- ErrorEmitter errorEmitter = CommandLineLauncher .launchTest (filePath .toAbsolutePath ().toString ());
32+ ErrorEmitter errorEmitter = CommandLineLauncher .launch (filePath .toAbsolutePath ().toString ());
3133
3234 // 2. Check if the file is correct or contains an error
3335 if ((fileName .startsWith ("Correct" ) && errorEmitter .foundError ())
@@ -68,4 +70,21 @@ private static Stream<Path> fileNameSource() throws IOException {
6870 return isFileStartingWithCorrectOrError || isDirectoryWithCorrectOrError ;
6971 });
7072 }
73+
74+ /**
75+ * Test multiple paths at once, including both files and directories. This test ensures that the verifier can handle
76+ * multiple inputs correctly and that no errors are found in files/directories that are expected to be correct.
77+ */
78+ @ Test
79+ public void testMultiplePaths () {
80+ String [] paths = { "../liquidjava-example/src/main/java/testSuite/SimpleTest.java" ,
81+ "../liquidjava-example/src/main/java/testSuite/classes/arraylist_correct" , };
82+ ErrorEmitter errorEmitter = CommandLineLauncher .launch (paths );
83+
84+ // Check if any of the paths that should be correct found an error
85+ if (errorEmitter .foundError ()) {
86+ System .out .println ("Error found in files that should be correct." );
87+ fail ();
88+ }
89+ }
7190}
0 commit comments