| Index: tests/compiler/dart2js/logical_expression_test.dart
|
| diff --git a/tests/compiler/dart2js/logical_expression_test.dart b/tests/compiler/dart2js/logical_expression_test.dart
|
| index 75d69e9026f3b0f554cdce01eb3750690579c5a8..5e9056aa196de9fedb842990a7061dc366954a74 100644
|
| --- a/tests/compiler/dart2js/logical_expression_test.dart
|
| +++ b/tests/compiler/dart2js/logical_expression_test.dart
|
| @@ -4,7 +4,8 @@
|
|
|
| // Test that logical or-expressions don't introduce unnecessary nots.
|
|
|
| -import "package:async_helper/async_helper.dart";
|
| +import 'dart:async';
|
| +import 'package:async_helper/async_helper.dart';
|
| import 'compiler_helper.dart';
|
|
|
| const String TEST_ONE = r"""
|
| @@ -24,24 +25,26 @@ void foo(list, bar) {
|
| """;
|
|
|
| main() {
|
| - // We want something like:
|
| - // var t1 = bar.call$0() === true;
|
| - // if (t1 || gee.call$0() === true) gee.call$0();
|
| - // if (t1 || gee.call$0() === true) gee.call$0();
|
| - compileAndDoNotMatchFuzzy(TEST_ONE, 'foo',
|
| - r"""var x = [a-zA-Z0-9$.]+\(\) == true;
|
| - if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;
|
| - if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;""");
|
| + asyncTest(() => Future.wait([
|
| + // We want something like:
|
| + // var t1 = bar.call$0() === true;
|
| + // if (t1 || gee.call$0() === true) gee.call$0();
|
| + // if (t1 || gee.call$0() === true) gee.call$0();
|
| + compileAndDoNotMatchFuzzy(TEST_ONE, 'foo',
|
| + r"""var x = [a-zA-Z0-9$.]+\(\) == true;
|
| + if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;
|
| + if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;"""),
|
|
|
|
|
| - // We want something like:
|
| - // var t1 = list == null;
|
| - // if (t1) bar.call$0();
|
| - // if (t1 || bar.call$0() === true) bar.call$0();
|
| - // if (t1 || bar.call$0() === true) bar.call$0();
|
| - compileAndMatchFuzzy(TEST_TWO, 'foo',
|
| - r"""var x = x == null;
|
| - if \(x\) [^;]+;
|
| - if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;
|
| - if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;""");
|
| + // We want something like:
|
| + // var t1 = list == null;
|
| + // if (t1) bar.call$0();
|
| + // if (t1 || bar.call$0() === true) bar.call$0();
|
| + // if (t1 || bar.call$0() === true) bar.call$0();
|
| + compileAndMatchFuzzy(TEST_TWO, 'foo',
|
| + r"""var x = x == null;
|
| + if \(x\) [^;]+;
|
| + if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;
|
| + if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;"""),
|
| + ]));
|
| }
|
|
|