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

Side by Side Diff: tests/language/src/ListLiteralTest.dart

Issue 8231031: Check for compile-time constants in DartCompiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Renamed CompileTimeConstTest to CTConst2Test Created 9 years, 2 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 // Test program for array literals. 4 // Test program for array literals.
5 5
6 class ListLiteralTest { 6 class ListLiteralTest {
7 7
8 static final LAUREL = 1; 8 static final LAUREL = 1;
9 static final HARDY = 2; 9 static final HARDY = 2;
10 10
(...skipping 19 matching lines...) Expand all
30 e2 = const <num>[5.1, -55, 555, 5555][2]; 30 e2 = const <num>[5.1, -55, 555, 5555][2];
31 Expect.equals(555, e2); 31 Expect.equals(555, e2);
32 32
33 e2 = const [5.1, const <num>[-55, 555], 5555][1][1]; 33 e2 = const [5.1, const <num>[-55, 555], 5555][1][1];
34 Expect.equals(555, e2); 34 Expect.equals(555, e2);
35 35
36 Expect.equals(0, [].length); 36 Expect.equals(0, [].length);
37 Expect.equals(0, <String>[].length); 37 Expect.equals(0, <String>[].length);
38 Expect.equals(0, const <String>[].length); 38 Expect.equals(0, const <String>[].length);
39 Expect.equals(0, const [].length); 39 Expect.equals(0, const [].length);
40
41 e2 = [1, 2.0, 0x03, 2.0e5];
42 Expect.equals(1, e2[0]);
43 Expect.equals(2.0, e2[1]);
44 Expect.equals(3, e2[2]);
45 Expect.equals(200000.0, e2[3]);
ngeoffray 2011/10/14 09:26:56 Unrelated change?
zundel 2011/10/14 10:04:21 I must have merged up since the previous patch.
40 } 46 }
41 } 47 }
42 48
43 main() { 49 main() {
44 ListLiteralTest.testMain(); 50 ListLiteralTest.testMain();
45 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698