OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
8 * Test various forms of function literals. | 6 * Test various forms of function literals. |
9 */ | 7 */ |
10 typedef int IntFunc(int); | 8 typedef int IntFunc(int); |
11 | 9 |
12 class FunctionLiteralsTest { | 10 class FunctionLiteralsTest { |
13 static void checkIntFunction(expected, int f(x), arg) { | 11 static void checkIntFunction(expected, int f(x), arg) { |
14 Expect.equals(expected, f(arg)); | 12 Expect.equals(expected, f(arg)); |
15 } | 13 } |
16 | 14 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 checkIntFunction(42, func2, 42); | 78 checkIntFunction(42, func2, 42); |
81 checkIntFunction(42, func3, 42); | 79 checkIntFunction(42, func3, 42); |
82 checkIntFunction(42, func4, 42); | 80 checkIntFunction(42, func4, 42); |
83 } | 81 } |
84 } | 82 } |
85 | 83 |
86 | 84 |
87 main() { | 85 main() { |
88 FunctionLiteralsTest.testMain(); | 86 FunctionLiteralsTest.testMain(); |
89 } | 87 } |
OLD | NEW |