Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: tests/corelib/string_pattern_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/string_from_list_test.dart ('k') | tests/corelib/string_replace_all_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « tests/corelib/string_from_list_test.dart ('k') | tests/corelib/string_replace_all_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698