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

Side by Side Diff: tests/language/ordered_maps_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/list_literal3_test.dart ('k') | tests/language/reg_exp2_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 4
5 // Tests that map literals are ordered. 5 // Tests that map literals are ordered.
6 6
7 class OrderedMapsTest { 7 class OrderedMapsTest {
8 static testMain() { 8 static testMain() {
9 testMaps(const { "a": 1, "c": 2 }, const { "c": 2, "a": 1}, true); 9 testMaps(const { "a": 1, "c": 2 }, const { "c": 2, "a": 1}, true);
10 testMaps({ "a": 1, "c": 2 }, { "c": 2, "a": 1 }, false); 10 testMaps({ "a": 1, "c": 2 }, { "c": 2, "a": 1 }, false);
11 } 11 }
12 12
13 static void testMaps(map1, map2, bool isConst) { 13 static void testMaps(map1, map2, bool isConst) {
14 Expect.equals(true, map1 !== map2); 14 Expect.isFalse(identical(map1, map2));
15 15
16 var keys = map1.keys; 16 var keys = map1.keys;
17 Expect.equals(2, keys.length); 17 Expect.equals(2, keys.length);
18 Expect.equals("a", keys[0]); 18 Expect.equals("a", keys[0]);
19 Expect.equals("c", keys[1]); 19 Expect.equals("c", keys[1]);
20 20
21 keys = map2.keys; 21 keys = map2.keys;
22 Expect.equals(2, keys.length); 22 Expect.equals(2, keys.length);
23 Expect.equals("c", keys[0]); 23 Expect.equals("c", keys[0]);
24 Expect.equals("a", keys[1]); 24 Expect.equals("a", keys[1]);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 values = map1.values; 70 values = map1.values;
71 Expect.equals(3, values.length); 71 Expect.equals(3, values.length);
72 Expect.equals(4, values[0]); 72 Expect.equals(4, values[0]);
73 } 73 }
74 } 74 }
75 75
76 main() { 76 main() {
77 OrderedMapsTest.testMain(); 77 OrderedMapsTest.testMain();
78 } 78 }
OLDNEW
« no previous file with comments | « tests/language/list_literal3_test.dart ('k') | tests/language/reg_exp2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698