OLD | NEW |
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"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 // Dart test for testing for in on a list literal. | 7 // Dart test for testing for in on a list literal. |
8 | 8 |
9 class ForInTest { | 9 class ForInTest { |
10 | |
11 static testMain() { | 10 static testMain() { |
12 testSimple(); | 11 testSimple(); |
13 testGenericSyntax1(); | 12 testGenericSyntax1(); |
14 testGenericSyntax2(); | 13 testGenericSyntax2(); |
15 testGenericSyntax3(); | 14 testGenericSyntax3(); |
16 testGenericSyntax4(); | 15 testGenericSyntax4(); |
17 } | 16 } |
18 | 17 |
19 static void testSimple() { | 18 static void testSimple() { |
20 var list = [1, 3, 5]; | 19 var list = [1, 3, 5]; |
(...skipping 18 matching lines...) Expand all Loading... |
39 static void testGenericSyntax3() { | 38 static void testGenericSyntax3() { |
40 List<List<List<String>>> aCollection = []; | 39 List<List<List<String>>> aCollection = []; |
41 for (List<List<String>> strArrArr in aCollection) {} | 40 for (List<List<String>> strArrArr in aCollection) {} |
42 } | 41 } |
43 | 42 |
44 static void testGenericSyntax4() { | 43 static void testGenericSyntax4() { |
45 List<List<List<String>>> aCollection = []; | 44 List<List<List<String>>> aCollection = []; |
46 List<List<String>> strArrArr; | 45 List<List<String>> strArrArr; |
47 for (strArrArr in aCollection) {} | 46 for (strArrArr in aCollection) {} |
48 } | 47 } |
49 | |
50 } | 48 } |
51 | 49 |
52 main() { | 50 main() { |
53 ForInTest.testMain(); | 51 ForInTest.testMain(); |
54 } | 52 } |
OLD | NEW |