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 | |
7 // Dart test program for testing named parameters with various values that might | 5 // Dart test program for testing named parameters with various values that might |
8 // be implemented as 'falsy' values in a JavaScript implementation. | 6 // be implemented as 'falsy' values in a JavaScript implementation. |
9 | 7 |
10 | 8 |
11 class TestClass { | 9 class TestClass { |
12 TestClass(); | 10 TestClass(); |
13 | 11 |
14 method([value = 100]) => value; | 12 method([value = 100]) => value; |
15 method2({value: 100}) => value; | 13 method2({value: 100}) => value; |
16 | 14 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 Expect.equals(v, TestClass.staticMethod2(value: v)); | 46 Expect.equals(v, TestClass.staticMethod2(value: v)); |
49 Expect.equals(v, globalMethod(v)); | 47 Expect.equals(v, globalMethod(v)); |
50 Expect.equals(v, globalMethod2(value: v)); | 48 Expect.equals(v, globalMethod2(value: v)); |
51 } | 49 } |
52 | 50 |
53 // Test via indirect call. | 51 // Test via indirect call. |
54 testFunction(obj.method, obj.method2); | 52 testFunction(obj.method, obj.method2); |
55 testFunction(TestClass.staticMethod, TestClass.staticMethod2); | 53 testFunction(TestClass.staticMethod, TestClass.staticMethod2); |
56 testFunction(globalMethod, globalMethod2); | 54 testFunction(globalMethod, globalMethod2); |
57 } | 55 } |
OLD | NEW |