| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import "package:collection/collection.dart"; | 5 import "package:collection/collection.dart"; |
| 6 import "package:unittest/unittest.dart"; | 6 import "package:test/test.dart"; |
| 7 | 7 |
| 8 void main() { | 8 void main() { |
| 9 group("with an empty canonicalized map", () { | 9 group("with an empty canonicalized map", () { |
| 10 var map; | 10 var map; |
| 11 setUp(() { | 11 setUp(() { |
| 12 map = new CanonicalizedMap<int, String, String>(int.parse, | 12 map = new CanonicalizedMap<int, String, String>(int.parse, |
| 13 isValidKey: new RegExp(r"^\d+$").hasMatch); | 13 isValidKey: new RegExp(r"^\d+$").hasMatch); |
| 14 }); | 14 }); |
| 15 | 15 |
| 16 test("canonicalizes keys on set and get", () { | 16 test("canonicalizes keys on set and get", () { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 var map = new CanonicalizedMap.from({ | 157 var map = new CanonicalizedMap.from({ |
| 158 "1": "value 1", | 158 "1": "value 1", |
| 159 "01": "value 2", | 159 "01": "value 2", |
| 160 "001": "value 3" | 160 "001": "value 3" |
| 161 }, int.parse); | 161 }, int.parse); |
| 162 expect(map.length, equals(1)); | 162 expect(map.length, equals(1)); |
| 163 expect(map["0001"], equals("value 3")); | 163 expect(map["0001"], equals("value 3")); |
| 164 }); | 164 }); |
| 165 }); | 165 }); |
| 166 } | 166 } |
| OLD | NEW |