Skip to content

Commit

Permalink
Add tests for the new cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed Dec 7, 2020
1 parent e1e1bb9 commit 0b8d5c8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/de/tum/in/testuser/InputOutputUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ void testLinesMatch(IOTester tester) {
"|| (( |", //
"Something");
}).isInstanceOf(AssertionFailedError.class).hasMessageContainingAll("more actual lines than expected: 1");

assertThatThrownBy(() -> {
tester.out().assertLinesMatch("This should not pass", //
">> 11 >>", //
"ABCDEF");
}).isInstanceOf(AssertionFailedError.class)
.hasMessageContainingAll("expected line #2:`ABCDEF` not found - actual lines depleted");

assertThatThrownBy(() -> {
tester.out().assertLinesMatch("This should not pass", //
">> 12 >>", //
"ABCDEF");
}).isInstanceOf(AssertionFailedError.class).hasMessageContainingAll(
"The output does not contain enough lines for the test to work, only 11 lines found.");
}

@PublicTest
Expand Down

0 comments on commit 0b8d5c8

Please sign in to comment.