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

Side by Side Diff: utils/tests/archive/reader_test.dart

Issue 12090093: Reapply "Rename mappedBy to map." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug in previous commit. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « utils/pub/version_solver.dart ('k') | utils/tests/pub/command_line_config.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 library reader_test; 5 library reader_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import '../../../pkg/unittest/lib/unittest.dart' 8 import '../../../pkg/unittest/lib/unittest.dart'
9 import '../../archive/archive.dart'; 9 import '../../archive/archive.dart';
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 test('reading a .tar.gz file with readAll', () { 52 test('reading a .tar.gz file with readAll', () {
53 var reader = new ArchiveReader(); 53 var reader = new ArchiveReader();
54 reader.format.tar = true; 54 reader.format.tar = true;
55 reader.filter.gzip = true; 55 reader.filter.gzip = true;
56 56
57 var future = reader.openFilename("$dataPath/test-archive.tar.gz") 57 var future = reader.openFilename("$dataPath/test-archive.tar.gz")
58 .then((input) => input.readAll()) 58 .then((input) => input.readAll())
59 .then((entries) { 59 .then((entries) {
60 entries = entries 60 entries = entries
61 .mappedBy((entry) => [entry.pathname, entry.contents.trim()]) 61 .map((entry) => [entry.pathname, entry.contents.trim()])
62 .toList(); 62 .toList();
63 expect(entries[0], orderedEquals(["filename1", "contents 1"])); 63 expect(entries[0], orderedEquals(["filename1", "contents 1"]));
64 expect(entries[1], orderedEquals(["filename2", "contents 2"])); 64 expect(entries[1], orderedEquals(["filename2", "contents 2"]));
65 expect(entries[2], orderedEquals(["filename3", "contents 3"])); 65 expect(entries[2], orderedEquals(["filename3", "contents 3"]));
66 }); 66 });
67 67
68 expect(future, completes); 68 expect(future, completes);
69 }); 69 });
70 70
71 test('reading an in-memory .tar.gz', () { 71 test('reading an in-memory .tar.gz', () {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 test("opening a non-existent archive", () { 191 test("opening a non-existent archive", () {
192 var reader = new ArchiveReader(); 192 var reader = new ArchiveReader();
193 reader.format.tar = true; 193 reader.format.tar = true;
194 reader.filter.gzip = true; 194 reader.filter.gzip = true;
195 195
196 expect(reader.openFilename("$dataPath/non-existent.tar.gz"), 196 expect(reader.openFilename("$dataPath/non-existent.tar.gz"),
197 throwsA((e) => e is ArchiveException)); 197 throwsA((e) => e is ArchiveException));
198 }); 198 });
199 } 199 }
200 200
OLDNEW
« no previous file with comments | « utils/pub/version_solver.dart ('k') | utils/tests/pub/command_line_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698