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