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 main() { | 7 main() { |
6 foo(true, [0]); | 8 foo(true, [0]); |
7 foo(false, "bar"); | 9 foo(false, "bar"); |
8 } | 10 } |
9 | 11 |
10 foo(check, listOrString) { | 12 foo(check, listOrString) { |
11 if (check) { | 13 if (check) { |
12 Expect.equals(0, listOrString[0]); | 14 Expect.equals(0, listOrString[0]); |
13 listOrString[0] = 1; | 15 listOrString[0] = 1; |
14 Expect.equals(1, listOrString[0]); | 16 Expect.equals(1, listOrString[0]); |
15 } else { | 17 } else { |
16 Expect.equals("foobar", "foo${listOrString}"); | 18 Expect.equals("foobar", "foo${listOrString}"); |
17 } | 19 } |
18 } | 20 } |
OLD | NEW |