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 | 4 |
5 library map_test; | 5 library map_test; |
| 6 import "package:expect/expect.dart"; |
6 import 'dart:collection'; | 7 import 'dart:collection'; |
7 | 8 |
8 void main() { | 9 void main() { |
9 test(new HashMap()); | 10 test(new HashMap()); |
10 test(new LinkedHashMap()); | 11 test(new LinkedHashMap()); |
11 test(new SplayTreeMap()); | 12 test(new SplayTreeMap()); |
12 test(new SplayTreeMap(Comparable.compare)); | 13 test(new SplayTreeMap(Comparable.compare)); |
13 testLinkedHashMap(); | 14 testLinkedHashMap(); |
14 testMapLiteral(); | 15 testMapLiteral(); |
15 testNullValue(); | 16 testNullValue(); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 359 |
359 var count = 0; | 360 var count = 0; |
360 map.forEach((key, value) { | 361 map.forEach((key, value) { |
361 if (key.isNaN) count++; | 362 if (key.isNaN) count++; |
362 }); | 363 }); |
363 Expect.equals(2, count); | 364 Expect.equals(2, count); |
364 | 365 |
365 map.clear(); | 366 map.clear(); |
366 Expect.isTrue(map.isEmpty); | 367 Expect.isTrue(map.isEmpty); |
367 } | 368 } |
OLD | NEW |