|
7 | 7 |
|
8 | 8 |
|
9 | 9 | public class StringContainsInOrderTest extends AbstractMatcherTest {
|
10 |
| - Matcher<String> m = stringContainsInOrder("a", "b", "c"); |
| 10 | + Matcher<String> m = stringContainsInOrder("a", "b", "c", "c"); |
11 | 11 |
|
12 | 12 | @Override
|
13 | 13 | protected Matcher<?> createMatcher() {
|
14 | 14 | return m;
|
15 | 15 | }
|
16 | 16 |
|
17 | 17 | public void testMatchesOnlyIfStringContainsGivenSubstringsInTheSameOrder() {
|
18 |
| - assertMatches("substrings in order", m, "abc"); |
19 |
| - assertMatches("substrings separated", m, "1a2b3c4"); |
| 18 | + assertMatches("all substrings adjacent in order", m, "abcc"); |
| 19 | + assertMatches("all substrings separated in order", m, "1a2b3c4c5"); |
20 | 20 |
|
21 |
| - assertDoesNotMatch("substrings out of order", m, "cab"); |
22 |
| - assertDoesNotMatch("no substrings in string", m, "xyz"); |
23 |
| - assertDoesNotMatch("substring missing", m, "ac"); |
| 21 | + assertDoesNotMatch("cumulative substring length longer than string", m, "abc"); |
| 22 | + assertDoesNotMatch("substrings out of order", m, "cabc"); |
| 23 | + assertDoesNotMatch("no substrings in string", m, "wxyz"); |
| 24 | + assertDoesNotMatch("substring not occurring", m, "axcc"); |
| 25 | + assertDoesNotMatch("substring missing", m, "acc"); |
24 | 26 | assertDoesNotMatch("empty string", m, "");
|
25 | 27 | }
|
26 | 28 |
|
27 | 29 | public void testHasAReadableDescription() {
|
28 |
| - assertDescription("a string containing \"a\", \"b\", \"c\" in order", m); |
| 30 | + assertDescription("a string containing \"a\", \"b\", \"c\", \"c\" in order", m); |
29 | 31 | }
|
30 | 32 | }
|
0 commit comments