OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // Dart test for testing String.allMatches. | 4 // Dart test for testing String.allMatches. |
5 | 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
6 String str = "this is a string with hello here and hello there"; | 8 String str = "this is a string with hello here and hello there"; |
7 | 9 |
8 main() { | 10 main() { |
9 testNoMatch(); | 11 testNoMatch(); |
10 testOneMatch(); | 12 testOneMatch(); |
11 testTwoMatches(); | 13 testTwoMatches(); |
12 testEmptyPattern(); | 14 testEmptyPattern(); |
13 testEmptyString(); | 15 testEmptyString(); |
14 testEmptyPatternAndString(); | 16 testEmptyPatternAndString(); |
15 } | 17 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 Iterable<Match> matches = pattern.allMatches(str); | 70 Iterable<Match> matches = pattern.allMatches(str); |
69 Expect.isFalse(matches.iterator.moveNext()); | 71 Expect.isFalse(matches.iterator.moveNext()); |
70 } | 72 } |
71 | 73 |
72 testEmptyPatternAndString() { | 74 testEmptyPatternAndString() { |
73 String pattern = ""; | 75 String pattern = ""; |
74 String str = ""; | 76 String str = ""; |
75 Iterable<Match> matches = pattern.allMatches(str); | 77 Iterable<Match> matches = pattern.allMatches(str); |
76 Expect.isTrue(matches.iterator.moveNext()); | 78 Expect.isTrue(matches.iterator.moveNext()); |
77 } | 79 } |
OLD | NEW |