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

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

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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 | « tests/language/scope_variable_test.dart ('k') | tests/language/strict_equal_test.dart » ('j') | 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) 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 // Dart test program for testing static const fields. 4 // Dart test program for testing static const fields.
5 5
6 abstract class Spain { 6 abstract class Spain {
7 static const AG = "Antoni Gaudi"; 7 static const AG = "Antoni Gaudi";
8 static const SD = "Salvador Dali"; 8 static const SD = "Salvador Dali";
9 } 9 }
10 10
(...skipping 18 matching lines...) Expand all
29 static const architect1 = Spain.AG; 29 static const architect1 = Spain.AG;
30 static const array1 = const <int>[1, 2]; 30 static const array1 = const <int>[1, 2];
31 static const map1 = const {"Monday": 1, "Tuesday": 2, }; 31 static const map1 = const {"Monday": 1, "Tuesday": 2, };
32 } 32 }
33 33
34 class StaticFinalFieldTest { 34 class StaticFinalFieldTest {
35 static testMain() { 35 static testMain() {
36 Expect.equals(15, A.c); 36 Expect.equals(15, A.c);
37 Expect.equals(8, A.b); 37 Expect.equals(8, A.b);
38 Expect.equals(5, A.a.n); 38 Expect.equals(5, A.a.n);
39 Expect.equals(true, 8 === A.b); 39 Expect.equals(true, identical(8, A.b));
40 Expect.equals(true, A.a === A.d); 40 Expect.equals(true, identical(A.a, A.d));
41 Expect.equals(true, A.s1 === A.s2); 41 Expect.equals(true, identical(A.s1, A.s2));
42 Expect.equals(false, A.s1 === A.s3); 42 Expect.equals(false, identical(A.s1, A.s3));
43 Expect.equals(false, A.s1 === A.b); 43 Expect.equals(false, identical(A.s1, A.b));
44 Expect.equals(true, A.d1 === A.d2); 44 Expect.equals(true, identical(A.d1, A.d2));
45 Expect.equals(true, Spain.SD == "Salvador Dali"); 45 Expect.equals(true, Spain.SD == "Salvador Dali");
46 Expect.equals(true, A.artist2 == "Alberto Giacometti"); 46 Expect.equals(true, A.artist2 == "Alberto Giacometti");
47 Expect.equals(true, A.architect1 == "Antoni Gaudi"); 47 Expect.equals(true, A.architect1 == "Antoni Gaudi");
48 Expect.equals(2, A.map1["Tuesday"]); 48 Expect.equals(2, A.map1["Tuesday"]);
49 } 49 }
50 } 50 }
51 51
52 main() { 52 main() {
53 StaticFinalFieldTest.testMain(); 53 StaticFinalFieldTest.testMain();
54 } 54 }
OLDNEW
« no previous file with comments | « tests/language/scope_variable_test.dart ('k') | tests/language/strict_equal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698