| 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"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 // Dart test program for testing named parameters with 'false' passed as an | 7 // Dart test program for testing named parameters with 'false' passed as an |
| 8 // argument. | 8 // argument. |
| 9 | 9 |
| 10 | |
| 11 class TestClass { | 10 class TestClass { |
| 12 TestClass(); | 11 TestClass(); |
| 13 | 12 |
| 14 bool method([bool value]) => value; | 13 bool method([bool value]) => value; |
| 15 bool method2({bool value}) => value; | 14 bool method2({bool value}) => value; |
| 16 | 15 |
| 17 static bool staticMethod([bool value]) => value; | 16 static bool staticMethod([bool value]) => value; |
| 18 static bool staticMethod2({bool value}) => value; | 17 static bool staticMethod2({bool value}) => value; |
| 19 } | 18 } |
| 20 | 19 |
| 21 bool globalMethod([bool value]) => value; | 20 bool globalMethod([bool value]) => value; |
| 22 bool globalMethod2({bool value}) => value; | 21 bool globalMethod2({bool value}) => value; |
| 23 | 22 |
| 24 | |
| 25 main() { | 23 main() { |
| 26 var obj = new TestClass(); | 24 var obj = new TestClass(); |
| 27 | 25 |
| 28 Expect.equals(null, obj.method()); | 26 Expect.equals(null, obj.method()); |
| 29 Expect.equals(null, obj.method2()); | 27 Expect.equals(null, obj.method2()); |
| 30 Expect.equals(true, obj.method(true)); | 28 Expect.equals(true, obj.method(true)); |
| 31 Expect.equals(true, obj.method2(value: true)); | 29 Expect.equals(true, obj.method2(value: true)); |
| 32 Expect.equals(false, obj.method(false)); | 30 Expect.equals(false, obj.method(false)); |
| 33 Expect.equals(false, obj.method2(value: false)); | 31 Expect.equals(false, obj.method2(value: false)); |
| 34 | 32 |
| 35 Expect.equals(null, TestClass.staticMethod()); | 33 Expect.equals(null, TestClass.staticMethod()); |
| 36 Expect.equals(null, TestClass.staticMethod2()); | 34 Expect.equals(null, TestClass.staticMethod2()); |
| 37 Expect.equals(true, TestClass.staticMethod(true)); | 35 Expect.equals(true, TestClass.staticMethod(true)); |
| 38 Expect.equals(true, TestClass.staticMethod2(value: true)); | 36 Expect.equals(true, TestClass.staticMethod2(value: true)); |
| 39 Expect.equals(false, TestClass.staticMethod(false)); | 37 Expect.equals(false, TestClass.staticMethod(false)); |
| 40 Expect.equals(false, TestClass.staticMethod2(value: false)); | 38 Expect.equals(false, TestClass.staticMethod2(value: false)); |
| 41 | 39 |
| 42 Expect.equals(null, globalMethod()); | 40 Expect.equals(null, globalMethod()); |
| 43 Expect.equals(null, globalMethod2()); | 41 Expect.equals(null, globalMethod2()); |
| 44 Expect.equals(true, globalMethod(true)); | 42 Expect.equals(true, globalMethod(true)); |
| 45 Expect.equals(true, globalMethod2(value: true)); | 43 Expect.equals(true, globalMethod2(value: true)); |
| 46 Expect.equals(false, globalMethod(false)); | 44 Expect.equals(false, globalMethod(false)); |
| 47 Expect.equals(false, globalMethod2(value: false)); | 45 Expect.equals(false, globalMethod2(value: false)); |
| 48 } | 46 } |
| OLD | NEW |