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

Side by Side Diff: tests/corelib/iterable_generate_test.dart

Issue 207693003: Syntax prohibits assignment in assert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 main() { 8 main() {
9 bool checkedMode = false; 9 bool checkedMode = false;
10 assert(checkedMode = true); 10 assert((checkedMode = true));
11 void test(expectedList, generatedIterable) { 11 void test(expectedList, generatedIterable) {
12 Expect.equals(expectedList.length, generatedIterable.length); 12 Expect.equals(expectedList.length, generatedIterable.length);
13 Expect.listEquals(expectedList, generatedIterable.toList()); 13 Expect.listEquals(expectedList, generatedIterable.toList());
14 } 14 }
15 test([], new Iterable.generate(0)); 15 test([], new Iterable.generate(0));
16 test([0], new Iterable.generate(1)); 16 test([0], new Iterable.generate(1));
17 test([0,1,2,3,4], new Iterable.generate(5)); 17 test([0,1,2,3,4], new Iterable.generate(5));
18 test(["0","1","2","3","4"], new Iterable.generate(5, (x) => "$x")); 18 test(["0","1","2","3","4"], new Iterable.generate(5, (x) => "$x"));
19 test([2,3,4,5,6], new Iterable.generate(7).skip(2)); 19 test([2,3,4,5,6], new Iterable.generate(7).skip(2));
20 test([0,1,2,3,4], new Iterable.generate(7).take(5)); 20 test([0,1,2,3,4], new Iterable.generate(7).take(5));
(...skipping 15 matching lines...) Expand all
36 Expect.isTrue(st is Iterable<String>); 36 Expect.isTrue(st is Iterable<String>);
37 Expect.isTrue(st.iterator is Iterator<String>); 37 Expect.isTrue(st.iterator is Iterator<String>);
38 Expect.isFalse(st is Iterable<int>); 38 Expect.isFalse(st is Iterable<int>);
39 Expect.isFalse(st.iterator is Iterator<int>); 39 Expect.isFalse(st.iterator is Iterator<int>);
40 test(["0","1","2","3","4"], st); 40 test(["0","1","2","3","4"], st);
41 41
42 if (checkedMode) { 42 if (checkedMode) {
43 Expect.throws(() => new Iterable<String>.generate(5)); 43 Expect.throws(() => new Iterable<String>.generate(5));
44 } 44 }
45 } 45 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698