| 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 // A subtest of the larger MapTest. Will eliminate once the full | 4 // A subtest of the larger MapTest. Will eliminate once the full |
| 5 // test is running. | 5 // test is running. |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; |
| 8 |
| 7 class MapTest { | 9 class MapTest { |
| 8 | 10 |
| 9 static void testDeletedElement(Map map) { | 11 static void testDeletedElement(Map map) { |
| 10 map.clear(); | 12 map.clear(); |
| 11 for (int i = 0; i < 100; i++) { | 13 for (int i = 0; i < 100; i++) { |
| 12 map[1] = 2; | 14 map[1] = 2; |
| 13 Expect.equals(1, map.length); | 15 Expect.equals(1, map.length); |
| 14 int x = map.remove(1); | 16 int x = map.remove(1); |
| 15 Expect.equals(2, x); | 17 Expect.equals(2, x); |
| 16 Expect.equals(0, map.length); | 18 Expect.equals(0, map.length); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 static testMain() { | 214 static testMain() { |
| 213 test(new Map()); | 215 test(new Map()); |
| 214 testKeys(new Map()); | 216 testKeys(new Map()); |
| 215 } | 217 } |
| 216 } | 218 } |
| 217 | 219 |
| 218 | 220 |
| 219 main() { | 221 main() { |
| 220 MapTest.testMain(); | 222 MapTest.testMain(); |
| 221 } | 223 } |
| OLD | NEW |