|
7 | 7 |
|
8 | 8 |
|
9 | 9 | public class StringContainsInOrderTest extends AbstractMatcherTest {
|
10 |
| - StringContainsInOrder m = new StringContainsInOrder(asList("a", "b", "c")); |
| 10 | + StringContainsInOrder m = new StringContainsInOrder(asList("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("substrings in order", m, "abcc"); |
| 19 | + assertMatches("substrings separated", m, "1a2b3c4c5"); |
20 | 20 |
|
| 21 | + assertDoesNotMatch("substrings in order missing a repeated pattern", m, "abc"); |
21 | 22 | assertDoesNotMatch("substrings out of order", m, "cab");
|
22 | 23 | assertDoesNotMatch("no substrings in string", m, "xyz");
|
23 | 24 | assertDoesNotMatch("substring missing", m, "ac");
|
24 | 25 | assertDoesNotMatch("empty string", m, "");
|
25 | 26 | }
|
26 | 27 |
|
27 | 28 | public void testHasAReadableDescription() {
|
28 |
| - assertDescription("a string containing \"a\", \"b\", \"c\" in order", m); |
| 29 | + assertDescription("a string containing \"a\", \"b\", \"c\", \"c\" in order", m); |
29 | 30 | }
|
30 | 31 | }
|
0 commit comments