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

Unified Diff: tests/language/switch_test.dart

Issue 10540114: Issue 3528. Additional checks for 'case expressions' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
Index: tests/language/switch_test.dart
diff --git a/tests/language/switch_test.dart b/tests/language/switch_test.dart
index a9955a9dae99bfdf2372c54306ddff2766238345..7f1470c4e0421b62f9858133c7ded799e73099bc 100644
--- a/tests/language/switch_test.dart
+++ b/tests/language/switch_test.dart
@@ -15,8 +15,6 @@ class Switcher {
case 2:
case 3:
x = 200; break;
- case "mister string":
- return 300;
case 4:
default: {
x = 400; break;
@@ -27,21 +25,10 @@ class Switcher {
test2 (val) {
switch (val) {
- case true: return 100;
case 1: return 200;
- case "1": return 300;
default: return 400;
}
}
-
- test3(val) {
- final int temp = 5;
- switch (true) {
- case temp == val:
- return true;
- }
- return false;
- }
}
@@ -51,15 +38,11 @@ class SwitchTest {
Expect.equals(100, s.test1(1));
Expect.equals(200, s.test1(2));
Expect.equals(200, s.test1(3));
- Expect.equals(300, s.test1("mister string"));
Expect.equals(400, s.test1(4));
Expect.equals(400, s.test1(5));
Expect.equals(200, s.test2(1));
- Expect.equals(300, s.test2("1"));
-
- Expect.equals(true, s.test3(5));
- Expect.equals(false, s.test3(6));
+ Expect.equals(400, s.test2(2));
}
}

Powered by Google App Engine
This is Rietveld 408576698