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

Unified Diff: pkg/unittest/lib/src/core_matchers.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: pkg/unittest/lib/src/core_matchers.dart
diff --git a/pkg/unittest/lib/src/core_matchers.dart b/pkg/unittest/lib/src/core_matchers.dart
index 20e9db2efbb2628e8a9bb4a0f55ad0961d2fadc0..cfb3254758a4ac56a120c0b8dc79722771c8c58f 100644
--- a/pkg/unittest/lib/src/core_matchers.dart
+++ b/pkg/unittest/lib/src/core_matchers.dart
@@ -98,15 +98,15 @@ class _DeepMatcher extends BaseMatcher {
if (actual is !Iterable) {
return 'is not Iterable';
}
- var expectedIterator = expected.iterator();
- var actualIterator = actual.iterator();
+ var expectedIterator = expected.iterator;
+ var actualIterator = actual.iterator;
var position = 0;
String reason = null;
while (reason == null) {
- if (expectedIterator.hasNext) {
- if (actualIterator.hasNext) {
- Description r = matcher(expectedIterator.next(),
- actualIterator.next(),
+ if (expectedIterator.moveNext()) {
+ if (actualIterator.moveNext()) {
+ Description r = matcher(expectedIterator.current,
+ actualIterator.current,
'mismatch at position ${position}',
depth);
if (r != null) reason = r.toString();
@@ -114,7 +114,7 @@ class _DeepMatcher extends BaseMatcher {
} else {
reason = 'shorter than expected';
}
- } else if (actualIterator.hasNext) {
+ } else if (actualIterator.moveNext()) {
reason = 'longer than expected';
} else {
return null;
« no previous file with comments | « pkg/unittest/lib/mock.dart ('k') | runtime/lib/array.dart » ('j') | runtime/lib/array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698