| Index: tests/language/function_type_alias_test.dart
|
| diff --git a/tests/language/function_type_alias_test.dart b/tests/language/function_type_alias_test.dart
|
| index c52700f29260a2f6195d08d0e8fa4a821fbdbdfc..0b3469fe392e9d8ab54b22b8eb16321b8a5d21de 100644
|
| --- a/tests/language/function_type_alias_test.dart
|
| +++ b/tests/language/function_type_alias_test.dart
|
| @@ -33,73 +33,88 @@ class FunctionTypeAliasTest {
|
| static int test(CompareObj compare, Object a, Object b) {
|
| return compare(a, b);
|
| }
|
| +
|
| foo(Test arg) {}
|
| static bar() {
|
| FunctionTypeAliasTest a = new FunctionTypeAliasTest();
|
| - a.foo(() { });
|
| + a.foo(() {});
|
| return 0;
|
| }
|
|
|
| static void testMain() {
|
| - int compareStrLen(String a, String b) { return a.length - b.length; }
|
| + int compareStrLen(String a, String b) {
|
| + return a.length - b.length;
|
| + }
|
| +
|
| Expect.isTrue(compareStrLen is Fun);
|
| Expect.isTrue(compareStrLen is IntFun);
|
| - Expect.isTrue(compareStrLen is !BoolFun);
|
| + Expect.isTrue(compareStrLen is! BoolFun);
|
| Expect.isTrue(compareStrLen is CompareObj);
|
| - Expect.isTrue(compareStrLen is !CompareInt);
|
| - Expect.isTrue(compareStrLen is !CompareString);
|
| + Expect.isTrue(compareStrLen is! CompareInt);
|
| + Expect.isTrue(compareStrLen is! CompareString);
|
| Expect.equals(3, test(compareStrLen, "abcdef", "xyz"));
|
|
|
| int compareStrLenSwap(String a, String b, [bool swap = false]) {
|
| return swap ? (a.length - b.length) : (b.length - a.length);
|
| }
|
| +
|
| Expect.isTrue(compareStrLenSwap is Fun);
|
| Expect.isTrue(compareStrLenSwap is IntFun);
|
| - Expect.isTrue(compareStrLenSwap is !BoolFun);
|
| + Expect.isTrue(compareStrLenSwap is! BoolFun);
|
| Expect.isTrue(compareStrLenSwap is CompareObj);
|
| - Expect.isTrue(compareStrLenSwap is !CompareInt);
|
| + Expect.isTrue(compareStrLenSwap is! CompareInt);
|
| Expect.isTrue(compareStrLenSwap is CompareString);
|
|
|
| int compareStrLenReverse(String a, String b, [bool reverse = false]) {
|
| return reverse ? (a.length - b.length) : (b.length - a.length);
|
| }
|
| +
|
| Expect.isTrue(compareStrLenReverse is Fun);
|
| Expect.isTrue(compareStrLenReverse is IntFun);
|
| - Expect.isTrue(compareStrLenReverse is !BoolFun);
|
| + Expect.isTrue(compareStrLenReverse is! BoolFun);
|
| Expect.isTrue(compareStrLenReverse is CompareObj);
|
| - Expect.isTrue(compareStrLenReverse is !CompareInt);
|
| + Expect.isTrue(compareStrLenReverse is! CompareInt);
|
| Expect.isTrue(compareStrLenReverse is CompareString);
|
|
|
| - int compareObj(Object a, Object b) { return identical(a, b) ? 0 : -1; }
|
| + int compareObj(Object a, Object b) {
|
| + return identical(a, b) ? 0 : -1;
|
| + }
|
| +
|
| Expect.isTrue(compareObj is Fun);
|
| Expect.isTrue(compareObj is IntFun);
|
| - Expect.isTrue(compareObj is !BoolFun);
|
| + Expect.isTrue(compareObj is! BoolFun);
|
| Expect.isTrue(compareObj is CompareObj);
|
| Expect.isTrue(compareObj is CompareInt);
|
| - Expect.isTrue(compareObj is !CompareString);
|
| + Expect.isTrue(compareObj is! CompareString);
|
| Expect.equals(-1, test(compareObj, "abcdef", "xyz"));
|
|
|
| - CompareInt minus = (int a, int b) { return a - b; };
|
| + CompareInt minus = (int a, int b) {
|
| + return a - b;
|
| + };
|
| Expect.isTrue(minus is Fun);
|
| Expect.isTrue(compareStrLen is IntFun);
|
| - Expect.isTrue(compareStrLen is !BoolFun);
|
| + Expect.isTrue(compareStrLen is! BoolFun);
|
| Expect.isTrue(minus is CompareObj);
|
| Expect.isTrue(minus is CompareInt);
|
| - Expect.isTrue(minus is !CompareString);
|
| + Expect.isTrue(minus is! CompareString);
|
| Expect.equals(99, test(minus, 100, 1));
|
|
|
| - int plus (int a, [int b = 1]) { return a + b; };
|
| + int plus(int a, [int b = 1]) {
|
| + return a + b;
|
| + }
|
| +
|
| + ;
|
| Expect.isTrue(plus is Fun);
|
| Expect.isTrue(plus is IntFun);
|
| - Expect.isTrue(plus is !BoolFun);
|
| + Expect.isTrue(plus is! BoolFun);
|
| Expect.isTrue(plus is CompareObj);
|
| Expect.isTrue(plus is CompareInt);
|
| - Expect.isTrue(plus is !CompareString);
|
| + Expect.isTrue(plus is! CompareString);
|
|
|
| Expect.equals(0, bar());
|
|
|
| - Function boundsTrue = (int arg) { };
|
| - Function boundsFalse = (String arg) { };
|
| + Function boundsTrue = (int arg) {};
|
| + Function boundsFalse = (String arg) {};
|
| Expect.isTrue(boundsTrue is BoundsCheck<num>);
|
| Expect.isFalse(boundsFalse is BoundsCheck<num>);
|
| }
|
|
|