Index: tests/compiler/dart2js/no_such_method_enabled_test.dart |
diff --git a/tests/compiler/dart2js/no_such_method_enabled_test.dart b/tests/compiler/dart2js/no_such_method_enabled_test.dart |
index 2f5f9c7498beedf06471a1d02419581e554bc7ca..ac8e4801caec362d6a890df403fb073226de2ad1 100644 |
--- a/tests/compiler/dart2js/no_such_method_enabled_test.dart |
+++ b/tests/compiler/dart2js/no_such_method_enabled_test.dart |
@@ -2,11 +2,12 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
+import 'dart:async'; |
import 'package:expect/expect.dart'; |
-import "package:async_helper/async_helper.dart"; |
+import 'package:async_helper/async_helper.dart'; |
import 'compiler_helper.dart'; |
-dummyImplTest() { |
+Future dummyImplTest() async { |
String source = """ |
class A { |
foo() => 3; |
@@ -18,16 +19,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest2() { |
+Future dummyImplTest2() async { |
String source = """ |
class A extends B { |
foo() => 3; |
@@ -40,16 +40,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest3() { |
+Future dummyImplTest3() async { |
String source = """ |
class A extends B { |
foo() => 3; |
@@ -64,16 +63,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest4() { |
+Future dummyImplTest4() async { |
String source = """ |
class A extends B { |
foo() => 3; |
@@ -88,20 +86,19 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- ClassElement clsB = findElement(compiler, 'B'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
- clsB.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
+ ClassElement clsB = findElement(compiler, 'B'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
+ clsB.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest5() { |
+Future dummyImplTest5() async { |
String source = """ |
class A extends B { |
foo() => 3; |
@@ -116,20 +113,19 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- ClassElement clsB = findElement(compiler, 'B'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
- clsB.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
+ ClassElement clsB = findElement(compiler, 'B'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
+ clsB.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest6() { |
+Future dummyImplTest6() async { |
String source = """ |
class A { |
noSuchMethod(x) => 3; |
@@ -140,16 +136,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest7() { |
+Future dummyImplTest7() async { |
String source = """ |
class A { |
noSuchMethod(x, [y]) => super.noSuchMethod(x); |
@@ -160,16 +155,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.defaultImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest8() { |
+Future dummyImplTest8() async { |
String source = """ |
class A { |
noSuchMethod(x, [y]) => super.noSuchMethod(x, y); |
@@ -180,16 +174,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest9() { |
+Future dummyImplTest9() async { |
String source = """ |
class A { |
noSuchMethod(x, y) => super.noSuchMethod(x); |
@@ -200,16 +193,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isFalse(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.notApplicableImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest10() { |
+Future dummyImplTest10() async { |
String source = """ |
class A { |
noSuchMethod(Invocation x) { |
@@ -222,16 +214,15 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest11() { |
+Future dummyImplTest11() async { |
String source = """ |
class A { |
noSuchMethod(Invocation x) { |
@@ -245,19 +236,18 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.complexNoReturnImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.complexNoReturnImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
-dummyImplTest12() { |
+Future dummyImplTest12() async { |
String source = """ |
class A { |
noSuchMethod(Invocation x) { |
@@ -270,29 +260,30 @@ main() { |
"""; |
Uri uri = new Uri(scheme: 'source'); |
var compiler = compilerFor(source, uri); |
- asyncTest(() => compiler.run(uri).then((_) { |
- Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
- ClassElement clsA = findElement(compiler, 'A'); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- Expect.isTrue( |
- compiler.backend.noSuchMethodRegistry.complexReturningImpls.contains( |
- clsA.lookupMember('noSuchMethod'))); |
- })); |
+ await compiler.run(uri); |
+ Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
+ ClassElement clsA = findElement(compiler, 'A'); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
+ Expect.isTrue( |
+ compiler.backend.noSuchMethodRegistry.complexReturningImpls.contains( |
+ clsA.lookupMember('noSuchMethod'))); |
} |
main() { |
- dummyImplTest(); |
- dummyImplTest2(); |
- dummyImplTest3(); |
- dummyImplTest4(); |
- dummyImplTest5(); |
- dummyImplTest6(); |
- dummyImplTest7(); |
- dummyImplTest8(); |
- dummyImplTest9(); |
- dummyImplTest10(); |
- dummyImplTest11(); |
- dummyImplTest12(); |
+ asyncTest(() async { |
+ await dummyImplTest(); |
+ await dummyImplTest2(); |
+ await dummyImplTest3(); |
+ await dummyImplTest4(); |
+ await dummyImplTest5(); |
+ await dummyImplTest6(); |
+ await dummyImplTest7(); |
+ await dummyImplTest8(); |
+ await dummyImplTest9(); |
+ await dummyImplTest10(); |
+ await dummyImplTest11(); |
+ await dummyImplTest12(); |
+ }); |
} |