| Index: tests/corelib/string_pattern_test.dart
|
| diff --git a/tests/corelib/string_pattern_test.dart b/tests/corelib/string_pattern_test.dart
|
| index 440855d1b7882702fcf3c1d4b5048a675090cfb7..6ab5e958dc9fcfafe2e06eead23255856d32537b 100644
|
| --- a/tests/corelib/string_pattern_test.dart
|
| +++ b/tests/corelib/string_pattern_test.dart
|
| @@ -18,15 +18,16 @@ testNoMatch() {
|
| // Also tests that RegExp groups don't work.
|
| String helloPattern = "with (hello)";
|
| Iterable<Match> matches = helloPattern.allMatches(str);
|
| - Expect.isFalse(matches.iterator().hasNext);
|
| + Expect.isFalse(matches.iterator.moveNext());
|
| }
|
|
|
| testOneMatch() {
|
| String helloPattern = "with hello";
|
| Iterable<Match> matches = helloPattern.allMatches(str);
|
| - var iterator = matches.iterator();
|
| - Match match = iterator.next();
|
| - Expect.isFalse(iterator.hasNext);
|
| + var iterator = matches.iterator;
|
| + Expect.isTrue(iterator.moveNext());
|
| + Match match = iterator.current;
|
| + Expect.isFalse(iterator.moveNext());
|
| Expect.equals(str.indexOf('with', 0), match.start);
|
| Expect.equals(str.indexOf('with', 0) + helloPattern.length, match.end);
|
| Expect.equals(helloPattern, match.pattern);
|
| @@ -58,19 +59,19 @@ testTwoMatches() {
|
| testEmptyPattern() {
|
| String pattern = "";
|
| Iterable<Match> matches = pattern.allMatches(str);
|
| - Expect.isTrue(matches.iterator().hasNext);
|
| + Expect.isTrue(matches.iterator.moveNext());
|
| }
|
|
|
| testEmptyString() {
|
| String pattern = "foo";
|
| String str = "";
|
| Iterable<Match> matches = pattern.allMatches(str);
|
| - Expect.isFalse(matches.iterator().hasNext);
|
| + Expect.isFalse(matches.iterator.moveNext());
|
| }
|
|
|
| testEmptyPatternAndString() {
|
| String pattern = "";
|
| String str = "";
|
| Iterable<Match> matches = pattern.allMatches(str);
|
| - Expect.isTrue(matches.iterator().hasNext);
|
| + Expect.isTrue(matches.iterator.moveNext());
|
| }
|
|
|