mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +00:00
[web] fix improperly migrated tests.
These tests had bugs intronduced during the the null-safety test migration. Surprisingly the failures didn't show up on some configurations because the tests were previosly not using the async-helper wrapper. As a result, the test was logged as completed and passing before it was done executing. Together this was the cause why these tests failed in d8 and flaked in firefox. This CL fixes both issues. A few notes: * web_2 tests didn't have bugs, but this CL also adds asyncHelper to match * it's quite possible that many of these `is` tests are optimized away in dart2js. I added a couple `confuse` calls when the trivial tests were highlighted by the analyzer directly (not based on whether or not dart2js optimized them away). Change-Id: I8f58c0b0b850023764524f57201eada89a5c0d6d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332062 Reviewed-by: Stephen Adams <sra@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
parent
d07ab72fb9
commit
4bcb0950f1
|
@ -5,14 +5,17 @@
|
|||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,15 +4,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,15 +4,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object Function(Null, Null));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object Function(Null, Null));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object? Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object? Function(Null, Null));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object? Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object? Function(Null, Null));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,15 +4,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object Function(Null, Null));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object Function(Null, Null));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object? Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object? Function(Null, Null));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object? Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object? Function(Null, Null));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,15 +4,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,15 +4,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,20 +5,26 @@
|
|||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(lib1.method5 is Object Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object Function(Null, String, int));
|
||||
Expect.isTrue(lib2.method6 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
@pragma('dart2js:never-inline')
|
||||
confuse(f) => f;
|
||||
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(confuse(lib1.method5) is Object? Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object? Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object? Function(Null, String, int));
|
||||
Expect.isTrue(confuse(lib2.method6) is Object? Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,21 +4,27 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object Function(Null, String, int));
|
||||
Expect.isTrue(lib2.method6 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(lib1.method5 is Object Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
@pragma('dart2js:never-inline')
|
||||
confuse(f) => f;
|
||||
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object? Function(Null, String, int));
|
||||
Expect.isTrue(confuse(lib2.method6) is Object? Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(confuse(lib1.method5) is Object? Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object? Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@ method1() {
|
|||
class Class1 {}
|
||||
|
||||
method3() {
|
||||
return (Class1 c) => c;
|
||||
return (Class1? c) => c;
|
||||
}
|
||||
|
||||
test3(o) => o is Class1 Function(Class1);
|
||||
test3(o) => o is Class1? Function(Class1?);
|
||||
|
||||
method5(Class1 c, String s, int i) {}
|
||||
method5(Class1? c, String s, int i) {}
|
||||
|
||||
test5(o) => o is Function(Class1, String, int);
|
||||
test5(o) => o is Function(Class1?, String, int);
|
||||
|
|
|
@ -9,11 +9,11 @@ method2() {
|
|||
class Class2 {}
|
||||
|
||||
method4() {
|
||||
return (Class2 c1, Class2 c2) => c1;
|
||||
return (Class2? c1, Class2? c2) => c1;
|
||||
}
|
||||
|
||||
test4(o) => o is Class2 Function(Class2, Class2);
|
||||
test4(o) => o is Class2? Function(Class2?, Class2?);
|
||||
|
||||
method6(Class2 c, int i, String s) {}
|
||||
method6(Class2? c, int i, String s) {}
|
||||
|
||||
test6(o) => o is Function(Class2, int, String);
|
||||
test6(o) => o is Function(Class2?, int, String);
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object Function(Null, Null));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object Function(Null, Null));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object Function(Null, Null));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object Function(Null, Null));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object Function(Null, Null));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object Function(Null, Null));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(Null));
|
||||
Expect.isTrue(lib2.method4() is Object Function(Null, Null));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method3() is Object Function(Null));
|
||||
Expect.isFalse(lib1.method3() is Object Function(Null, Null));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,15 +6,18 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method4() is Object Function(String, String));
|
||||
Expect.isTrue(lib2.test4(lib2.method4()));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.test3(lib1.method3()));
|
||||
Expect.isFalse(lib1.method3() is Object Function(String));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,21 +6,24 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(lib1.method5 is Object Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object Function(Null, String, int));
|
||||
Expect.isTrue(lib2.method6 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(lib1.method5 is Object Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object Function(Null, String, int));
|
||||
Expect.isTrue(lib2.method6 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -6,21 +6,24 @@
|
|||
|
||||
// dart2jsOptions=--strong
|
||||
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'deferred_function_types_lib1.dart' deferred as lib1;
|
||||
import 'deferred_function_types_lib2.dart' deferred as lib2;
|
||||
|
||||
main() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object Function(Null, String, int));
|
||||
Expect.isTrue(lib2.method6 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(lib1.method5 is Object Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
main() {
|
||||
asyncTest(() async {
|
||||
await lib2.loadLibrary();
|
||||
Expect.isFalse(lib2.method2() is int Function(int));
|
||||
Expect.isTrue(lib2.method2() is String Function(String));
|
||||
Expect.isFalse(lib2.method6 is Object Function(Null, String, int));
|
||||
Expect.isTrue(lib2.method6 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib2.test6(lib2.method6));
|
||||
await lib1.loadLibrary();
|
||||
Expect.isTrue(lib1.method1() is int Function(int));
|
||||
Expect.isFalse(lib1.method1() is String Function(String));
|
||||
Expect.isTrue(lib1.method5 is Object Function(Null, String, int));
|
||||
Expect.isFalse(lib1.method5 is Object Function(Null, int, String));
|
||||
Expect.isTrue(lib1.test5(lib1.method5));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue