November 2024
Intermediate to advanced
300 pages
7h 12m
English
Your long test appears to represent two distinct cases. The first demonstrates finding a search result, and the second represents finding no match. The blank line provides a clear dividing point:
| | @Test |
| | void testSearch() throws IOException { |
| | var stream = streamOn("There are certain queer times and occasions " |
| | // ... |
| | var search = new Search(stream, "practical joke", A_TITLE); |
| | Search.LOGGER.setLevel(Level.OFF); |
| | search.setSurroundingCharacterCount(10); |
| | search.execute(); |
| | assertFalse(search.errored()); |
| | var matches = search.getMatches(); |
| | assertEquals(List.of( |
| | new Match(A_TITLE, |
| | "practical joke", |
| | "or a vast practical ... |
Read now
Unlock full access