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

Unified Diff: tests/corelib_strong/splay_tree_from_iterable_test.dart

Issue 2683893002: Make corelib_strong tests strong-mode compliant (Closed)
Patch Set: Created 3 years, 10 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
« tests/corelib_strong/sort_test.dart ('K') | « tests/corelib_strong/sort_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib_strong/splay_tree_from_iterable_test.dart
diff --git a/tests/corelib_strong/splay_tree_from_iterable_test.dart b/tests/corelib_strong/splay_tree_from_iterable_test.dart
index 6ba1818b51ca49371c8a06bea0ef468cfd458f29..35bdf9204ed6720dfc7a4437de08be797bae4cfb 100644
--- a/tests/corelib_strong/splay_tree_from_iterable_test.dart
+++ b/tests/corelib_strong/splay_tree_from_iterable_test.dart
@@ -117,6 +117,8 @@ void genericTypeTest() {
Expect.isFalse(map is SplayTreeMap<String, dynamic>);
Expect.isFalse(map is SplayTreeMap<dynamic, int>);
}
+typedef String intToString(int v);
+typedef bool intToBool(int v);
// Test in checked mode with explicitly given types.
void typedTest() {
@@ -124,11 +126,11 @@ void typedTest() {
assert((isCheckedMode = true));
if (!isCheckedMode) return;
- // Assign functions to untyped function variables.
- Function key = (int v) => "$v";
- Function value = (int v) => v.isOdd;
+ // Assign functions to typed function variables.
+ intToString key = (int v) => "$v";
+ intToBool value = (int v) => v.isOdd;
Function id = (int i) => i;
-
+
Expect.throws(() {
new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
key: key
@@ -145,7 +147,7 @@ void typedTest() {
Expect.throws(() {
new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
- key: id, // wrong type.
+ key: id as dynamic, // wrong type.
value: value
);
});
@@ -153,7 +155,7 @@ void typedTest() {
Expect.throws(() {
new SplayTreeMap<String,bool>.fromIterable(<int>[1, 2, 3],
key: key,
- value: id // wrong type.
+ value: id as dynamic // wrong type.
);
});
« tests/corelib_strong/sort_test.dart ('K') | « tests/corelib_strong/sort_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698