OLD | NEW |
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 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 import 'compiler_helper.dart'; | 8 import 'compiler_helper.dart'; |
9 | 9 |
10 const String SIMPLY_EMPTY = """ | 10 const String SIMPLY_EMPTY = """ |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 print(a+b); | 114 print(a+b); |
115 } | 115 } |
116 """; | 116 """; |
117 | 117 |
118 main() { | 118 main() { |
119 var def = new RegExp(r"default:"); | 119 var def = new RegExp(r"default:"); |
120 var defOrCase3 = new RegExp(r"(default:|case 3):"); | 120 var defOrCase3 = new RegExp(r"(default:|case 3):"); |
121 var case3 = new RegExp(r"case 3:"); | 121 var case3 = new RegExp(r"case 3:"); |
122 | 122 |
123 asyncTest(() => Future.wait([ | 123 asyncTest(() => Future.wait([ |
124 compileAndDoNotMatch(SIMPLY_EMPTY, 'main', def), | 124 compileAndDoNotMatch(SIMPLY_EMPTY, 'main', def), |
125 compileAndDoNotMatch(TOTAL, 'main', defOrCase3), | 125 compileAndDoNotMatch(TOTAL, 'main', defOrCase3), |
126 compileAndDoNotMatch(OPTIMIZED, 'main', def), | 126 compileAndDoNotMatch(OPTIMIZED, 'main', def), |
127 compileAndMatch(LABEL, 'main', case3), | 127 compileAndMatch(LABEL, 'main', case3), |
128 compileAndMatch(DEFLABEL, 'main', def), | 128 compileAndMatch(DEFLABEL, 'main', def), |
129 compileAndMatch(EMPTYDEFLABEL, 'main', def), | 129 compileAndMatch(EMPTYDEFLABEL, 'main', def), |
130 ])); | 130 ])); |
131 } | 131 } |
OLD | NEW |