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

Side by Side Diff: tests/compiler/dart2js/switch_empty_default_test.dart

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Test constant folding on numbers. 4 // Test constant folding on numbers.
5 5
6 import "package:expect/expect.dart"; 6 import 'dart:async';
7 import 'package:async_helper/async_helper.dart';
7 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
8 9
9 const String SIMPLY_EMPTY = """ 10 const String SIMPLY_EMPTY = """
10 int foo(x) => x; 11 int foo(x) => x;
11 void main() { 12 void main() {
12 var a = foo(4); 13 var a = foo(4);
13 var b = 1; 14 var b = 1;
14 switch (a) { 15 switch (a) {
15 case 1: 16 case 1:
16 b += 2; 17 b += 2;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 113 }
113 print(a+b); 114 print(a+b);
114 } 115 }
115 """; 116 """;
116 117
117 main() { 118 main() {
118 var def = new RegExp(r"default:"); 119 var def = new RegExp(r"default:");
119 var defOrCase3 = new RegExp(r"(default:|case 3):"); 120 var defOrCase3 = new RegExp(r"(default:|case 3):");
120 var case3 = new RegExp(r"case 3:"); 121 var case3 = new RegExp(r"case 3:");
121 122
122 compileAndDoNotMatch(SIMPLY_EMPTY, 'main', def); 123 asyncTest(() => Future.wait([
123 compileAndDoNotMatch(TOTAL, 'main', defOrCase3); 124 compileAndDoNotMatch(SIMPLY_EMPTY, 'main', def),
124 compileAndDoNotMatch(OPTIMIZED, 'main', def); 125 compileAndDoNotMatch(TOTAL, 'main', defOrCase3),
125 compileAndMatch(LABEL, 'main', case3); 126 compileAndDoNotMatch(OPTIMIZED, 'main', def),
126 compileAndMatch(DEFLABEL, 'main', def); 127 compileAndMatch(LABEL, 'main', case3),
127 compileAndMatch(EMPTYDEFLABEL, 'main', def); 128 compileAndMatch(DEFLABEL, 'main', def),
129 compileAndMatch(EMPTYDEFLABEL, 'main', def),
130 ]));
128 } 131 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/string_escapes_test.dart ('k') | tests/compiler/dart2js/type_checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698