OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // This copy of hash_map2_test exercises the internal Map implementation. |
| 6 // VMOptions=--use_internal_hash_map |
| 7 |
5 // Tests of hash map behavior, with focus in iteration and concurrent | 8 // Tests of hash map behavior, with focus in iteration and concurrent |
6 // modification errors. | 9 // modification errors. |
7 | 10 |
8 library hash_map2_test; | 11 library hash_map2_test; |
9 import "package:expect/expect.dart"; | 12 import "package:expect/expect.dart"; |
10 import 'dart:collection'; | 13 import 'dart:collection'; |
11 | 14 |
12 testMap(Map newMap(), Map newMapFrom(Map map)) { | 15 testMap(Map newMap(), Map newMapFrom(Map map)) { |
13 Map gen(int from, int to) { | 16 Map gen(int from, int to) { |
14 Map map = new LinkedHashMap(); | 17 Map map = new LinkedHashMap(); |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 testMap(() => new LinkedHashMap(), (m) => new LinkedHashMap.from(m)); | 284 testMap(() => new LinkedHashMap(), (m) => new LinkedHashMap.from(m)); |
282 } | 285 } |
283 | 286 |
284 | 287 |
285 class BadHashCode { | 288 class BadHashCode { |
286 static int idCounter = 0; | 289 static int idCounter = 0; |
287 final int id; | 290 final int id; |
288 BadHashCode() : id = idCounter++; | 291 BadHashCode() : id = idCounter++; |
289 int get hashCode => 42; | 292 int get hashCode => 42; |
290 } | 293 } |
OLD | NEW |