| 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 class IC { | 7 class IC { |
| 6 int count = 0; | 8 int count = 0; |
| 7 String toString() => "${count++}"; | 9 String toString() => "${count++}"; |
| 8 } | 10 } |
| 9 | 11 |
| 10 testJoin(String expect, Iterable iterable, [String separator]) { | 12 testJoin(String expect, Iterable iterable, [String separator]) { |
| 11 Expect.equals(expect, iterable.join(separator)); | 13 Expect.equals(expect, iterable.join(separator)); |
| 12 } | 14 } |
| 13 | 15 |
| 14 testCollections() { | 16 testCollections() { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 testJoin("abcd", ["a", "b", "c", "d"].map((x) => x)); | 63 testJoin("abcd", ["a", "b", "c", "d"].map((x) => x)); |
| 62 testJoin("null,b,c,d", [null,"b","c","d"].map((x) => x), ","); | 64 testJoin("null,b,c,d", [null,"b","c","d"].map((x) => x), ","); |
| 63 testJoin("1,2,3,4", [1, 2, 3, 4].map((x) => x), ","); | 65 testJoin("1,2,3,4", [1, 2, 3, 4].map((x) => x), ","); |
| 64 testJoin("4,5,6,7", [ic, ic, ic, ic].map((x) => x), ","); | 66 testJoin("4,5,6,7", [ic, ic, ic, ic].map((x) => x), ","); |
| 65 } | 67 } |
| 66 | 68 |
| 67 main() { | 69 main() { |
| 68 testCollections(); | 70 testCollections(); |
| 69 // TODO(lrn): test scalar lists. | 71 // TODO(lrn): test scalar lists. |
| 70 } | 72 } |
| OLD | NEW |