support multiple output lines in test

master
Lothar Buchholz 4 years ago
parent 6b5cb71874
commit bd5d3fab64

@ -53,7 +53,14 @@ class SolutionTest {
System.out.println( String.format( "Solution took %01d.%03d secs", duration / 1000, duration % 1000 ));
try (BufferedReader chk = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( bos.toByteArray() )))) {
assertEquals( expected, chk.readLine() );
String[] expectedLines = expected.split( "\\s*[|]\\s*" );
int lineCount = 0;
String line;
for ( ; (line = chk.readLine()) != null; lineCount++ ) {
assertEquals( expectedLines[ lineCount ], line );
}
assertEquals( expectedLines.length, lineCount );
}
}
finally {

Loading…
Cancel
Save