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 // Test program for array literals. | 4 // Test program for array literals. |
5 | 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
6 class ListLiteralTest { | 8 class ListLiteralTest { |
7 | 9 |
8 static const LAUREL = 1; | 10 static const LAUREL = 1; |
9 static const HARDY = 2; | 11 static const HARDY = 2; |
10 | 12 |
11 static testMain() { | 13 static testMain() { |
12 | 14 |
13 var funny = <int>[LAUREL, HARDY, ]; // Check that trailing comma works. | 15 var funny = <int>[LAUREL, HARDY, ]; // Check that trailing comma works. |
14 Expect.equals(2, funny.length); | 16 Expect.equals(2, funny.length); |
15 | 17 |
(...skipping 26 matching lines...) Expand all Loading... |
42 Expect.equals(1, e2[0]); | 44 Expect.equals(1, e2[0]); |
43 Expect.equals(2.0, e2[1]); | 45 Expect.equals(2.0, e2[1]); |
44 Expect.equals(3, e2[2]); | 46 Expect.equals(3, e2[2]); |
45 Expect.equals(200000.0, e2[3]); | 47 Expect.equals(200000.0, e2[3]); |
46 } | 48 } |
47 } | 49 } |
48 | 50 |
49 main() { | 51 main() { |
50 ListLiteralTest.testMain(); | 52 ListLiteralTest.testMain(); |
51 } | 53 } |
OLD | NEW |