Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: tests/corelib/map_test.dart

Issue 1319783003: Add static ensure() methods to unmodifiable views. Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sdk/lib/collection/maps.dart ('K') | « sdk/lib/collection/maps.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/map_test.dart
diff --git a/tests/corelib/map_test.dart b/tests/corelib/map_test.dart
index 79d1ace519b3fb3b0cfada9be45aefa09e513916..4898699902635af0956383616b95a377932e3e65 100644
--- a/tests/corelib/map_test.dart
+++ b/tests/corelib/map_test.dart
@@ -123,6 +123,7 @@ void main() {
testUnmodifiableMap(const {1 : 37});
testUnmodifiableMap(new UnmodifiableMapView({1 : 37}));
testUnmodifiableMap(new UnmodifiableMapBaseMap([1, 37]));
+ testUnmodifiableMap(UnmodifiableMapView.ensure({1 : 37}));
Lasse Reichstein Nielsen 2015/08/27 07:59:04 Also test that UnmodifiableMapView.ensure called w
nweiz 2015/08/27 19:25:38 It does that in the body of [testUnmodifiableMap]
testFrom();
}
@@ -750,6 +751,8 @@ void testUnmodifiableMap(Map map) {
Expect.throws(() { map.remove(1); });
Expect.throws(() { map[2] = 42; });
Expect.throws(() { map.addAll({2 : 42}); });
+
+ Expect.isTrue(identical(map, UnmodifiableMapView.ensure(map)));
}
class Customer {
« sdk/lib/collection/maps.dart ('K') | « sdk/lib/collection/maps.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698