OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
5 // Dart test program for testing named parameters with various values that might | 7 // Dart test program for testing named parameters with various values that might |
6 // be implemented as 'falsy' values in a JavaScript implementation. | 8 // be implemented as 'falsy' values in a JavaScript implementation. |
7 | 9 |
8 | 10 |
9 class TestClass { | 11 class TestClass { |
10 TestClass(); | 12 TestClass(); |
11 | 13 |
12 method([value = 100]) => value; | 14 method([value = 100]) => value; |
13 method2({value: 100}) => value; | 15 method2({value: 100}) => value; |
14 | 16 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 Expect.equals(v, TestClass.staticMethod2(value: v)); | 48 Expect.equals(v, TestClass.staticMethod2(value: v)); |
47 Expect.equals(v, globalMethod(v)); | 49 Expect.equals(v, globalMethod(v)); |
48 Expect.equals(v, globalMethod2(value: v)); | 50 Expect.equals(v, globalMethod2(value: v)); |
49 } | 51 } |
50 | 52 |
51 // Test via indirect call. | 53 // Test via indirect call. |
52 testFunction(obj.method, obj.method2); | 54 testFunction(obj.method, obj.method2); |
53 testFunction(TestClass.staticMethod, TestClass.staticMethod2); | 55 testFunction(TestClass.staticMethod, TestClass.staticMethod2); |
54 testFunction(globalMethod, globalMethod2); | 56 testFunction(globalMethod, globalMethod2); |
55 } | 57 } |
OLD | NEW |