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

Side by Side Diff: tests/compiler/dart2js_extra/for_in_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart";
6
7 // Test foreach (aka. for-in) functionality. 5 // Test foreach (aka. for-in) functionality.
8 6
9 testIterator(List expect, Iterable input) { 7 testIterator(List expect, Iterable input) {
10 int i = 0; 8 int i = 0;
11 for (var value in input) { 9 for (var value in input) {
12 Expect.isTrue(i < expect.length); 10 Expect.isTrue(i < expect.length);
13 Expect.equals(expect[i], value); 11 Expect.equals(expect[i], value);
14 i += 1; 12 i += 1;
15 } 13 }
16 Expect.equals(expect.length, i); 14 Expect.equals(expect.length, i);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 72
75 // Using the same variable (showing that the expression is evaluated 73 // Using the same variable (showing that the expression is evaluated
76 // in the outer scope). 74 // in the outer scope).
77 int result = 0; 75 int result = 0;
78 var x = [1,2,3]; 76 var x = [1,2,3];
79 for (var x in x) { 77 for (var x in x) {
80 result += x; 78 result += x;
81 } 79 }
82 Expect.equals(6, result); 80 Expect.equals(6, result);
83 } 81 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/first_class_types_hashcode_test.dart ('k') | tests/compiler/dart2js_extra/for_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698