OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
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_ONE = r""" | 10 const String TEST_ONE = r""" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 i++; | 48 i++; |
49 if (i == 5) continue; | 49 if (i == 5) continue; |
50 x += i; | 50 x += i; |
51 } | 51 } |
52 return x; | 52 return x; |
53 } | 53 } |
54 """; | 54 """; |
55 | 55 |
56 main() { | 56 main() { |
57 asyncTest(() => Future.wait([ | 57 asyncTest(() => Future.wait([ |
58 compile(TEST_ONE, entry: 'foo', check: (String generated) { | 58 compile(TEST_ONE, entry: 'foo', check: (String generated) { |
59 Expect.isTrue(generated.contains(r'for (')); | 59 Expect.isTrue(generated.contains(r'for (')); |
60 }), | 60 }), |
61 compile(TEST_TWO, entry: 'foo', check: (String generated) { | 61 compile(TEST_TWO, entry: 'foo', check: (String generated) { |
62 Expect.isTrue(!generated.contains(r'break')); | 62 Expect.isTrue(!generated.contains(r'break')); |
63 }), | 63 }), |
64 compile(TEST_THREE, entry: 'foo', check: (String generated) { | 64 compile(TEST_THREE, entry: 'foo', check: (String generated) { |
65 Expect.isTrue(generated.contains(r'continue')); | 65 Expect.isTrue(generated.contains(r'continue')); |
66 }), | 66 }), |
67 compile(TEST_FOUR, entry: 'foo', check: (String generated) { | 67 compile(TEST_FOUR, entry: 'foo', check: (String generated) { |
68 Expect.isTrue(generated.contains(r'continue')); | 68 Expect.isTrue(generated.contains(r'continue')); |
69 }), | 69 }), |
70 ])); | 70 ])); |
71 } | 71 } |
OLD | NEW |