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

Side by Side Diff: tests/language/canonical_const_test.dart

Issue 10837359: Language tests updated to use const instead of final. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 4 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 // Check that initializers of static const fields are compile time constants. 4 // Check that initializers of static const fields are compile time constants.
5 5
6 class CanonicalConstTest { 6 class CanonicalConstTest {
7 static final A = const C1(); 7 static const A = const C1();
8 static final B = const C2(); 8 static const B = const C2();
9 9
10 static testMain() { 10 static testMain() {
11 Expect.isTrue(null===null); 11 Expect.isTrue(null===null);
12 Expect.isTrue(null!==0); 12 Expect.isTrue(null!==0);
13 Expect.isTrue(1===1); 13 Expect.isTrue(1===1);
14 Expect.isTrue(1!==2); 14 Expect.isTrue(1!==2);
15 Expect.isTrue(true===true); 15 Expect.isTrue(true===true);
16 Expect.isTrue("so"==="so"); 16 Expect.isTrue("so"==="so");
17 Expect.isTrue(const Object()===const Object()); 17 Expect.isTrue(const Object()===const Object());
18 Expect.isTrue(const Object()!==const C1()); 18 Expect.isTrue(const Object()!==const C1());
(...skipping 16 matching lines...) Expand all
35 const C1(); 35 const C1();
36 } 36 }
37 37
38 class C2 extends C1 { 38 class C2 extends C1 {
39 const C2() : super(); 39 const C2() : super();
40 } 40 }
41 41
42 main() { 42 main() {
43 CanonicalConstTest.testMain(); 43 CanonicalConstTest.testMain();
44 } 44 }
OLDNEW
« no previous file with comments | « tests/language/call_through_null_getter_test.dart ('k') | tests/language/compile_time_constant2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698