| Index: tests/language/named_parameters_passing_falsy_test.dart
|
| ===================================================================
|
| --- tests/language/named_parameters_passing_falsy_test.dart (revision 12414)
|
| +++ tests/language/named_parameters_passing_falsy_test.dart (working copy)
|
| @@ -10,19 +10,22 @@
|
| TestClass();
|
|
|
| method([value = 100]) => value;
|
| + method2({value: 100}) => value;
|
|
|
| static staticMethod([value = 200]) => value;
|
| + static staticMethod2({value: 200}) => value;
|
| }
|
|
|
| globalMethod([value = 300]) => value;
|
| +globalMethod2({value: 300}) => value;
|
|
|
| const testValues = const [0, 0.0, '', false, null];
|
|
|
| -testFunction(f) {
|
| +testFunction(f, f2) {
|
| Expect.isTrue(f() >= 100);
|
| for (var v in testValues) {
|
| Expect.equals(v, f(v));
|
| - Expect.equals(v, f(value: v));
|
| + Expect.equals(v, f2(value: v));
|
| }
|
| }
|
|
|
| @@ -30,20 +33,23 @@
|
| var obj = new TestClass();
|
|
|
| Expect.equals(100, obj.method());
|
| + Expect.equals(100, obj.method2());
|
| Expect.equals(200, TestClass.staticMethod());
|
| + Expect.equals(200, TestClass.staticMethod2());
|
| Expect.equals(300, globalMethod());
|
| + Expect.equals(300, globalMethod2());
|
|
|
| for (var v in testValues) {
|
| Expect.equals(v, obj.method(v));
|
| - Expect.equals(v, obj.method(value: v));
|
| + Expect.equals(v, obj.method2(value: v));
|
| Expect.equals(v, TestClass.staticMethod(v));
|
| - Expect.equals(v, TestClass.staticMethod(value: v));
|
| + Expect.equals(v, TestClass.staticMethod2(value: v));
|
| Expect.equals(v, globalMethod(v));
|
| - Expect.equals(v, globalMethod(value: v));
|
| + Expect.equals(v, globalMethod2(value: v));
|
| }
|
|
|
| // Test via indirect call.
|
| - testFunction(obj.method);
|
| - testFunction(TestClass.staticMethod);
|
| - testFunction(globalMethod);
|
| + testFunction(obj.method, obj.method2);
|
| + testFunction(TestClass.staticMethod, TestClass.staticMethod2);
|
| + testFunction(globalMethod, globalMethod2);
|
| }
|
|
|