Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: tests/corelib/iterable_join_test.dart

Issue 17977002: - Remove arguments definition test from the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/corelib/apply_test.dart ('k') | tests/corelib/list_fill_range_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"; 5 import "package:expect/expect.dart";
6 6
7 class IC { 7 class IC {
8 int count = 0; 8 int count = 0;
9 String toString() => "${count++}"; 9 String toString() => "${count++}";
10 } 10 }
11 11
12 testJoin(String expect, Iterable iterable, [String separator = ""]) { 12 testJoin(String expect, Iterable iterable, [String separator]) {
13 if (?separator) { 13 if (separator != null) {
14 Expect.equals(expect, iterable.join(separator)); 14 Expect.equals(expect, iterable.join(separator));
15 } else { 15 } else {
16 Expect.equals(expect, iterable.join()); 16 Expect.equals(expect, iterable.join());
17 } 17 }
18 } 18 }
19 19
20 testCollections() { 20 testCollections() {
21 testJoin("", [], ","); 21 testJoin("", [], ",");
22 testJoin("", [], ""); 22 testJoin("", [], "");
23 testJoin("", []); 23 testJoin("", []);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 testJoin("abcd", ["a", "b", "c", "d"].map((x) => x)); 67 testJoin("abcd", ["a", "b", "c", "d"].map((x) => x));
68 testJoin("null,b,c,d", [null,"b","c","d"].map((x) => x), ","); 68 testJoin("null,b,c,d", [null,"b","c","d"].map((x) => x), ",");
69 testJoin("1,2,3,4", [1, 2, 3, 4].map((x) => x), ","); 69 testJoin("1,2,3,4", [1, 2, 3, 4].map((x) => x), ",");
70 testJoin("4,5,6,7", [ic, ic, ic, ic].map((x) => x), ","); 70 testJoin("4,5,6,7", [ic, ic, ic, ic].map((x) => x), ",");
71 } 71 }
72 72
73 main() { 73 main() {
74 testCollections(); 74 testCollections();
75 // TODO(lrn): test scalar lists. 75 // TODO(lrn): test scalar lists.
76 } 76 }
OLDNEW
« no previous file with comments | « tests/corelib/apply_test.dart ('k') | tests/corelib/list_fill_range_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698