| Index: tests/corelib/string_pattern_test.dart
|
| diff --git a/tests/corelib/string_pattern_test.dart b/tests/corelib/string_pattern_test.dart
|
| index c1bd241b7c9cca90e9ca540bae4348c4cdac478f..4229617ff1a7551f3c34dc3db6772e5aa25c75a9 100644
|
| --- a/tests/corelib/string_pattern_test.dart
|
| +++ b/tests/corelib/string_pattern_test.dart
|
| @@ -15,6 +15,7 @@ main() {
|
| testEmptyString();
|
| testEmptyPatternAndString();
|
| testMatchAsPrefix();
|
| + testAllMatchesStart();
|
| }
|
|
|
| testNoMatch() {
|
| @@ -97,3 +98,15 @@ testMatchAsPrefix() {
|
| Expect.throws(() => pattern.matchAsPrefix(str, -1));
|
| Expect.throws(() => pattern.matchAsPrefix(str, 7));
|
| }
|
| +
|
| +testAllMatchesStart() {
|
| + String p = "ass";
|
| + String s = "assassin";
|
| + Expect.equals(2, p.allMatches(s).length);
|
| + Expect.equals(2, p.allMatches(s, 0).length);
|
| + Expect.equals(1, p.allMatches(s, 1).length);
|
| + Expect.equals(0, p.allMatches(s, 4).length);
|
| + Expect.equals(0, p.allMatches(s, s.length).length);
|
| + Expect.throws(() => p.allMatches(s, -1));
|
| + Expect.throws(() => p.allMatches(s, s.length + 1));
|
| +}
|
|
|