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

Unified Diff: tests/corelib/reg_exp_all_matches_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/reg_exp5_test.dart ('k') | tests/corelib/reg_exp_start_end_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fb4616c2f06c3a8833d0c5bd1eb57469ee647214..27c8ea7e9901b8c1e5233019c357e9ab6aa5a328 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() {
@@ -40,7 +40,7 @@ class RegExpAllMatchesTest {
static testMap() {
var matches = new RegExp("foo?").allMatches("foo fo foo fo");
- var mapped = matches.map((Match m) => "${m.group(0)}bar");
+ var mapped = matches.mappedBy((Match m) => "${m.group(0)}bar");
Expect.equals(4, mapped.length);
var strbuf = new StringBuffer();
for (String s in mapped) {
@@ -51,7 +51,7 @@ class RegExpAllMatchesTest {
static testFilter() {
var matches = new RegExp("foo?").allMatches("foo fo foo fo");
- var filtered = matches.filter((Match m) {
+ var filtered = matches.where((Match m) {
return m.group(0) == 'foo';
});
Expect.equals(2, filtered.length);
@@ -74,13 +74,13 @@ class RegExpAllMatchesTest {
static testSome() {
var matches = new RegExp("foo?").allMatches("foo fo foo fo");
- Expect.equals(true, matches.some((Match m) {
+ Expect.equals(true, matches.any((Match m) {
return m.group(0).startsWith("fo");
}));
- Expect.equals(true, matches.some((Match m) {
+ Expect.equals(true, matches.any((Match m) {
return m.group(0).startsWith("foo");
}));
- Expect.equals(false, matches.some((Match m) {
+ Expect.equals(false, matches.any((Match m) {
return m.group(0).startsWith("fooo");
}));
}
« no previous file with comments | « tests/corelib/reg_exp5_test.dart ('k') | tests/corelib/reg_exp_start_end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698