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

Side by Side Diff: test/iterable_zip_test.dart

Issue 1638163002: Modernize the package's style. (Closed) Base URL: git@github.com:dart-lang/collection@master
Patch Set: Code review changes Created 4 years, 10 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
« no previous file with comments | « pubspec.yaml ('k') | test/priority_queue_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "dart:collection"; 5 import "dart:collection";
6 import "package:collection/iterable_zip.dart"; 6
7 import "package:test/test.dart"; 7 import "package:test/test.dart";
8 8
9 import "package:collection/collection.dart";
10
9 /// Iterable like [base] except that it throws when value equals [errorValue]. 11 /// Iterable like [base] except that it throws when value equals [errorValue].
10 Iterable iterError(Iterable base, int errorValue) { 12 Iterable iterError(Iterable base, int errorValue) {
11 return base.map((x) => x == errorValue ? throw "BAD" : x); 13 return base.map((x) => x == errorValue ? throw "BAD" : x);
12 } 14 }
13 15
14 main() { 16 main() {
15 test("Basic", () { 17 test("Basic", () {
16 expect(new IterableZip([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), 18 expect(new IterableZip([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
17 equals([[1, 4, 7], [2, 5, 8], [3, 6, 9]])); 19 equals([[1, 4, 7], [2, 5, 8], [3, 6, 9]]));
18 }); 20 });
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 throwsA(equals("BAD"))); 105 throwsA(equals("BAD")));
104 }); 106 });
105 107
106 test("Error after first end", () { 108 test("Error after first end", () {
107 expect(new IterableZip([[1, 2, 3], 109 expect(new IterableZip([[1, 2, 3],
108 [4, 5, 6], 110 [4, 5, 6],
109 iterError([7, 8, 9, 10], 10)]), 111 iterError([7, 8, 9, 10], 10)]),
110 equals([[1, 4, 7], [2, 5, 8], [3, 6, 9]])); 112 equals([[1, 4, 7], [2, 5, 8], [3, 6, 9]]));
111 }); 113 });
112 } 114 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/priority_queue_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698