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