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

Side by Side Diff: tests/compiler/dart2js/kernel/switch_test.dart

Issue 3003283003: Handle missing break in last switch case (Closed)
Patch Set: Created 3 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import 'package:test/test.dart'; 1 import 'package:test/test.dart';
2 2
3 import 'helper.dart' show check; 3 import 'helper.dart' show check;
4 4
5 main() { 5 main() {
6 test('simple switch statement', () { 6 test('simple switch statement', () {
7 String code = ''' 7 String code = '''
8 main() { 8 main() {
9 int x = 2; 9 int x = 2;
10 switch(x) { 10 switch(x) {
(...skipping 14 matching lines...) Expand all
25 int x = 5; 25 int x = 5;
26 switch(x) { 26 switch(x) {
27 case 1: 27 case 1:
28 print('spider'); 28 print('spider');
29 break; 29 break;
30 case 2: 30 case 2:
31 print('grasshopper'); 31 print('grasshopper');
32 break; 32 break;
33 default: 33 default:
34 print('ladybug'); 34 print('ladybug');
35
36 } 35 }
37 }'''; 36 }''';
38 return check(code, useKernelInSsa: true); 37 return check(code);
39 }); 38 });
40 39
41 /* 40 /*
42 // TODO(efortuna): Uncomment. Because of patch file weirdness, the original 41 // TODO(efortuna): Uncomment. Because of patch file weirdness, the original
43 // SSA vs the Kernel version is instantiating a subclass of the 42 // SSA vs the Kernel version is instantiating a subclass of the
44 // FallThroughError, so it produces slightly different code. Fix that. 43 // FallThroughError, so it produces slightly different code. Fix that.
45 test('switch with fall through error', () { 44 test('switch with fall through error', () {
46 String code = ''' 45 String code = '''
47 main() { 46 main() {
48 int x = 2; 47 int x = 2;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 switch(x) { 87 switch(x) {
89 case 1: 88 case 1:
90 print('spider'); 89 print('spider');
91 break; 90 break;
92 case 5: 91 case 5:
93 print('beetle'); 92 print('beetle');
94 break; 93 break;
95 case 6: 94 case 6:
96 } 95 }
97 }'''; 96 }''';
98 return check(code, useKernelInSsa: true); 97 return check(code);
99 }); 98 });
100 99
101 test('switch with labeled continue', () { 100 test('switch with labeled continue', () {
102 String code = ''' 101 String code = '''
103 main() { 102 main() {
104 int x = 1; 103 int x = 1;
105 switch(x) { 104 switch(x) {
106 case 1: 105 case 1:
107 print('spider'); 106 print('spider');
108 continue world; 107 continue world;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 print('beetle'); 174 print('beetle');
176 break; 175 break;
177 case 6: 176 case 6:
178 print('cricket'); 177 print('cricket');
179 break; 178 break;
180 } 179 }
181 }'''; 180 }''';
182 return check(code, useKernelInSsa: true); 181 return check(code, useKernelInSsa: true);
183 }); 182 });
184 } 183 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698