Index: tests/corelib/map_from_test.dart |
diff --git a/tests/corelib/map_from_test.dart b/tests/corelib/map_from_test.dart |
index 21597fbef38dd38fde9f0aa0ce85fdebc55cd88a..41db674100ee8a2c1afaaa23306a81b7d71409cd 100644 |
--- a/tests/corelib/map_from_test.dart |
+++ b/tests/corelib/map_from_test.dart |
@@ -9,6 +9,7 @@ import 'dart:collection'; |
main() { |
testWithConstMap(); |
testWithNonConstMap(); |
+ testWithHashMap(); |
testWithLinkedMap(); |
} |
@@ -16,8 +17,8 @@ testWithConstMap() { |
var map = const { 'b': 42, 'a': 43 }; |
var otherMap = new Map.from(map); |
Expect.isTrue(otherMap is Map); |
- Expect.isTrue(otherMap is HashMap); |
- Expect.isTrue(otherMap is !LinkedHashMap); |
+ Expect.isTrue(otherMap is! HashMap); |
+ Expect.isTrue(otherMap is LinkedHashMap); |
Expect.equals(2, otherMap.length); |
Expect.equals(2, otherMap.keys.length); |
@@ -37,8 +38,8 @@ testWithNonConstMap() { |
var map = { 'b': 42, 'a': 43 }; |
var otherMap = new Map.from(map); |
Expect.isTrue(otherMap is Map); |
- Expect.isTrue(otherMap is HashMap); |
- Expect.isTrue(otherMap is !LinkedHashMap); |
+ Expect.isTrue(otherMap is! HashMap); |
+ Expect.isTrue(otherMap is LinkedHashMap); |
Expect.equals(2, otherMap.length); |
Expect.equals(2, otherMap.keys.length); |
@@ -68,6 +69,18 @@ testWithNonConstMap() { |
Expect.equals(3, otherMap.values.length); |
} |
+testWithHashMap() { |
+ var map = const { 'b': 1, 'a': 2, 'c': 3 }; |
+ var otherMap = new HashMap.from(map); |
+ Expect.isTrue(otherMap is Map); |
+ Expect.isTrue(otherMap is HashMap); |
+ Expect.isTrue(otherMap is !LinkedHashMap); |
+ var i = 1; |
+ for (var val in map.values) { |
+ Expect.equals(i++, val); |
+ } |
+} |
+ |
testWithLinkedMap() { |
var map = const { 'b': 1, 'a': 2, 'c': 3 }; |
var otherMap = new LinkedHashMap.from(map); |