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 class ContextArgsWithDefaultsTest { | 7 class ContextArgsWithDefaultsTest { |
8 static void testMain() { | 8 static void testMain() { |
9 crasher(1, 'foo')(); | 9 crasher(1, 'foo')(); |
10 } | 10 } |
11 | 11 |
12 static crasher(int fixed, [String optional = '']) { | 12 static crasher(int fixed, [String optional = '']) { |
13 return () { | 13 return () { |
14 Expect.equals(1, fixed); | 14 Expect.equals(1, fixed); |
15 Expect.equals('foo', optional); | 15 Expect.equals('foo', optional); |
16 }; | 16 }; |
17 } | 17 } |
18 | |
19 } | 18 } |
20 | 19 |
21 main() { | 20 main() { |
22 ContextArgsWithDefaultsTest.testMain(); | 21 ContextArgsWithDefaultsTest.testMain(); |
23 } | 22 } |
OLD | NEW |