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

Unified Diff: tests/corelib/reg_exp_all_matches_test.dart

Issue 11410086: Use iterator, moveNext(), current. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Address comments. Created 8 years, 1 month 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
Index: tests/corelib/reg_exp_all_matches_test.dart
diff --git a/tests/corelib/reg_exp_all_matches_test.dart b/tests/corelib/reg_exp_all_matches_test.dart
index ba9b4c37f6955fe26c184c9f50615f11a7d0a70e..ac2f300f3e14354a2b9305cbde51aa18afe5083f 100644
--- a/tests/corelib/reg_exp_all_matches_test.dart
+++ b/tests/corelib/reg_exp_all_matches_test.dart
@@ -7,26 +7,26 @@
class RegExpAllMatchesTest {
static testIterator() {
var matches = new RegExp("foo").allMatches("foo foo");
- Iterator it = matches.iterator();
- Expect.equals(true, it.hasNext);
- Expect.equals('foo', it.next().group(0));
- Expect.equals(true, it.hasNext);
- Expect.equals('foo', it.next().group(0));
- Expect.equals(false, it.hasNext);
+ Iterator it = matches.iterator;
+ Expect.isTrue(it.moveNext());
+ Expect.equals('foo', it.current.group(0));
+ Expect.isTrue(it.moveNext());
+ Expect.equals('foo', it.current.group(0));
+ Expect.isFalse(it.moveNext());
// Run two iterators over the same results.
- it = matches.iterator();
- Iterator it2 = matches.iterator();
- Expect.equals(true, it.hasNext);
- Expect.equals(true, it2.hasNext);
- Expect.equals('foo', it.next().group(0));
- Expect.equals('foo', it2.next().group(0));
- Expect.equals(true, it.hasNext);
- Expect.equals(true, it2.hasNext);
- Expect.equals('foo', it.next().group(0));
- Expect.equals('foo', it2.next().group(0));
- Expect.equals(false, it.hasNext);
- Expect.equals(false, it2.hasNext);
+ it = matches.iterator;
+ Iterator it2 = matches.iterator;
+ Expect.isTrue(it.moveNext());
+ Expect.isTrue(it2.moveNext());
+ Expect.equals('foo', it.current.group(0));
+ Expect.equals('foo', it2.current.group(0));
+ Expect.isTrue(it.moveNext());
+ Expect.isTrue(it2.moveNext());
+ Expect.equals('foo', it.current.group(0));
+ Expect.equals('foo', it2.current.group(0));
+ Expect.equals(false, it.moveNext());
+ Expect.equals(false, it2.moveNext());
}
static testForEach() {

Powered by Google App Engine
This is Rietveld 408576698