| 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_IF = r""" | 10 const String TEST_IF = r""" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 RegExp validAdd = | 76 RegExp validAdd = |
| 77 new RegExp("($anyIdentifier \\+ 42)|($anyIdentifier \\+= 42)"); | 77 new RegExp("($anyIdentifier \\+ 42)|($anyIdentifier \\+= 42)"); |
| 78 RegExp invalidAdd = new RegExp("$anyIdentifier \\+ 53"); | 78 RegExp invalidAdd = new RegExp("$anyIdentifier \\+ 53"); |
| 79 Expect.isTrue(validAdd.hasMatch(generated)); | 79 Expect.isTrue(validAdd.hasMatch(generated)); |
| 80 Expect.isFalse(invalidAdd.hasMatch(generated)); | 80 Expect.isFalse(invalidAdd.hasMatch(generated)); |
| 81 }); | 81 }); |
| 82 } | 82 } |
| 83 | 83 |
| 84 main() { | 84 main() { |
| 85 asyncTest(() => Future.wait([ | 85 asyncTest(() => Future.wait([ |
| 86 compileAndTest(TEST_IF), | 86 compileAndTest(TEST_IF), |
| 87 compileAndTest(TEST_IF_ELSE), | 87 compileAndTest(TEST_IF_ELSE), |
| 88 compileAndTest(TEST_IF_RETURN), | 88 compileAndTest(TEST_IF_RETURN), |
| 89 compileAndTest(TEST_IF_NOT_ELSE), | 89 compileAndTest(TEST_IF_NOT_ELSE), |
| 90 compileAndTest(TEST_IF_NOT_RETURN), | 90 compileAndTest(TEST_IF_NOT_RETURN), |
| 91 compileAndTest(TEST_IF_NOT_ELSE_RETURN), | 91 compileAndTest(TEST_IF_NOT_ELSE_RETURN), |
| 92 ])); | 92 ])); |
| 93 } | 93 } |
| OLD | NEW |