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 TEST_1 = """ | 10 const String TEST_1 = """ |
(...skipping 17 matching lines...) Expand all Loading... |
28 const String TEST_3 = """ | 28 const String TEST_3 = """ |
29 foo() { | 29 foo() { |
30 var a = 'Hello'; | 30 var a = 'Hello'; |
31 var b = 55; | 31 var b = 55; |
32 return a.codeUnitAt(b); | 32 return a.codeUnitAt(b); |
33 } | 33 } |
34 """; | 34 """; |
35 | 35 |
36 main() { | 36 main() { |
37 asyncTest(() => Future.wait([ | 37 asyncTest(() => Future.wait([ |
38 compileAndMatch(TEST_1, 'foo', new RegExp(r'return 72')), | 38 compileAndMatch(TEST_1, 'foo', new RegExp(r'return 72')), |
39 compileAndDoNotMatch(TEST_1, 'foo', new RegExp(r'Hello')), | 39 compileAndDoNotMatch(TEST_1, 'foo', new RegExp(r'Hello')), |
40 | 40 compileAndMatch(TEST_2, 'foo', new RegExp(r'Hello')), |
41 compileAndMatch(TEST_2, 'foo', new RegExp(r'Hello')), | 41 compileAndMatch(TEST_3, 'foo', new RegExp(r'Hello')), |
42 compileAndMatch(TEST_3, 'foo', new RegExp(r'Hello')), | 42 ])); |
43 ])); | |
44 } | 43 } |
OLD | NEW |