| 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 // Test named arguments work as expected regardless of whether the function or | 5 // Test named arguments work as expected regardless of whether the function or |
| 6 // method is called via function call syntax or method call syntax. | 6 // method is called via function call syntax or method call syntax. |
| 7 | 7 |
| 8 import "package:expect/expect.dart"; | |
| 9 | |
| 10 | 8 |
| 11 Validate(tag, a, b) { | 9 Validate(tag, a, b) { |
| 12 // tag encodes which parameters are passed in with values a: 111, b: 222. | 10 // tag encodes which parameters are passed in with values a: 111, b: 222. |
| 13 if (tag == 'ab') { | 11 if (tag == 'ab') { |
| 14 Expect.equals(a, 111); | 12 Expect.equals(a, 111); |
| 15 Expect.equals(b, 222); | 13 Expect.equals(b, 222); |
| 16 } | 14 } |
| 17 if (tag == 'a') { | 15 if (tag == 'a') { |
| 18 Expect.equals(a, 111); | 16 Expect.equals(a, 111); |
| 19 Expect.equals(b, 20); | 17 Expect.equals(b, 20); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // 'Conversion' calls where method/field call syntax does not match the | 130 // 'Conversion' calls where method/field call syntax does not match the |
| 133 // object. | 131 // object. |
| 134 testMethodCallSyntax(new HasField()); | 132 testMethodCallSyntax(new HasField()); |
| 135 testFunctionCallSyntax(new HasMethod()); | 133 testFunctionCallSyntax(new HasMethod()); |
| 136 } | 134 } |
| 137 } | 135 } |
| 138 | 136 |
| 139 main() { | 137 main() { |
| 140 NamedParametersWithConversionsTest.testMain(); | 138 NamedParametersWithConversionsTest.testMain(); |
| 141 } | 139 } |
| OLD | NEW |