Tweaked unit test finish conditions

This commit is contained in:
Robinson 2021-09-24 13:14:15 +02:00
parent 1faac35ec3
commit f4142d49b9
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 9 additions and 2 deletions

View File

@ -30,8 +30,15 @@ class PrintInputToOutput {
String line = null;
int count = 0;
while ((line = br.readLine()) != null) {
System.out.print(line);
count++;
System.out.println(line);
// only end this if we have 3 line breaks EXCLUSIVE (with no text following)
if (line.isEmpty()) {
count++;
} else {
count = 0;
}
if (count == 3) {
break;
}