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

Unified Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 2033693003: ExitDetector: Do not special case enums, since null exists (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/all_the_rest_test.dart
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index 3594bfbb5972891ffcaefa716b592d85b633a6fc..fcf09dee47dbea8966b6d5a44f4c9f13fd799970 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -3916,10 +3916,10 @@ String f(E e) {
}
}
''');
- _assertNthStatementExits(source, 0);
+ _assertNthStatementDoesNotExit(source, 0);
}
- void test_switch_withEnum_true_withDefault() {
+ void test_switch_withEnum_true_withExitingDefault() {
Source source = addSource(r'''
enum E { A, B }
String f(E e) {
@@ -3934,6 +3934,22 @@ String f(E e) {
_assertNthStatementExits(source, 0);
}
+ void test_switch_withEnum_true_withNonExitingDefault() {
+ Source source = addSource(r'''
+enum E { A, B }
+String f(E e) {
+ var x;
+ switch (e) {
+ case A:
+ return 'A';
+ default:
+ x = '?';
+ }
+}
+''');
+ _assertNthStatementDoesNotExit(source, 1);
+ }
+
void test_whileStatement_breakWithLabel() {
Source source = addSource(r'''
void f() {
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698