| Index: tests/language_2/function_type/test_generator.dart
|
| diff --git a/tests/language/function_type/test_generator.dart b/tests/language_2/function_type/test_generator.dart
|
| similarity index 94%
|
| rename from tests/language/function_type/test_generator.dart
|
| rename to tests/language_2/function_type/test_generator.dart
|
| index 1a9360c1a1727e99caaeafb945485bd59cdfd853..c2c95cbd7d24903e11e2348d0c30e4cc79c43824 100644
|
| --- a/tests/language/function_type/test_generator.dart
|
| +++ b/tests/language_2/function_type/test_generator.dart
|
| @@ -596,21 +596,21 @@ final TEST_METHOD_HEADER = """
|
|
|
| // Tests that apply for every type.
|
| final COMMON_TESTS_TEMPLATE = """
|
| - Expect.isTrue(#staticFunName is #typeName);
|
| - Expect.isTrue(confuse(#staticFunName) is #typeName);
|
| + Expect.isTrue(#staticFunName is #typeName<int>);
|
| + Expect.isTrue(confuse(#staticFunName) is #typeName<int>);
|
| // In checked mode, verifies the type.
|
| #typeCode #localName;
|
| // The static function #staticFunName sets `T` to `int`.
|
| - if (!tIsBool) {
|
| + if (tIsInt) {
|
| #fieldName = #staticFunName as dynamic;
|
| #localName = #staticFunName as dynamic;
|
| #fieldName = confuse(#staticFunName);
|
| #localName = confuse(#staticFunName);
|
| }
|
|
|
| - Expect.isTrue(#methodFunName is #typeName);
|
| + Expect.isTrue(#methodFunName is #typeName<T>);
|
| Expect.isTrue(#methodFunName is #typeCode);
|
| - Expect.isTrue(confuse(#methodFunName) is #typeName);
|
| + Expect.isTrue(confuse(#methodFunName) is #typeName<T>);
|
| // In checked mode, verifies the type.
|
| #fieldName = #methodFunName;
|
| #localName = #methodFunName;
|
| @@ -631,25 +631,22 @@ final COMMON_TESTS_TEMPLATE = """
|
| // f(List<T> x) {}
|
| // }
|
| final TYPEDEF_T_TESTS_TEMPLATE = """
|
| - if (!tIsBool) {
|
| - Expect.isTrue(#staticFunName is #typeName<int>);
|
| - Expect.isFalse(#staticFunName is #typeName<bool>);
|
| - Expect.isTrue(confuse(#staticFunName) is #typeName<int>);
|
| - Expect.isFalse(confuse(#staticFunName) is #typeName<bool>);
|
| - Expect.equals(tIsDynamic, #methodFunName is #typeName<bool>);
|
| - Expect.equals(tIsDynamic, confuse(#methodFunName) is #typeName<bool>);
|
| - } else {
|
| - if (typeAssertionsEnabled) {
|
| - Expect.throws(() { #fieldName = (#staticFunName as dynamic); });
|
| - Expect.throws(() { #fieldName = confuse(#staticFunName); });
|
| - #typeCode #localName;
|
| - Expect.throws(() { #localName = (#staticFunName as dynamic); });
|
| - Expect.throws(() { #localName = confuse(#staticFunName); });
|
| - }
|
| - #typeCode #localName = #methodFunName;
|
| - // In checked mode, verifies the type.
|
| - #fieldName = #methodFunName;
|
| - #fieldName = confuse(#methodFunName);
|
| + // The static function has its T always set to int.
|
| + Expect.isTrue(#staticFunName is #typeName<int>);
|
| + Expect.isFalse(#staticFunName is #typeName<bool>);
|
| + Expect.isTrue(confuse(#staticFunName) is #typeName<int>);
|
| + Expect.isFalse(confuse(#staticFunName) is #typeName<bool>);
|
| + if (tIsBool) {
|
| + Expect.throws(() { #fieldName = (#staticFunName as dynamic); });
|
| + Expect.throws(() { #fieldName = confuse(#staticFunName); });
|
| + Expect.throws(() { #localName = (#staticFunName as dynamic); });
|
| + Expect.throws(() { #localName = confuse(#staticFunName); });
|
| + }
|
| + if (tIsInt || tIsBool) {
|
| + Expect.equals(tIsInt, #methodFunName is #typeName<int>);
|
| + Expect.equals(tIsBool, #methodFunName is #typeName<bool>);
|
| + Expect.equals(tIsInt, confuse(#methodFunName) is #typeName<int>);
|
| + Expect.equals(tIsBool, confuse(#methodFunName) is #typeName<bool>);
|
| }""";
|
|
|
| final TEST_METHOD_FOOTER = " }";
|
|
|