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

Unified Diff: utils/tests/archive/reader_test.dart

Issue 10830191: Add ArchiveInputStream.readAll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: utils/tests/archive/reader_test.dart
diff --git a/utils/tests/archive/reader_test.dart b/utils/tests/archive/reader_test.dart
index 79d15692d725c8dd5af9330d13e8fc1af651f25a..93e6722e3f96b3fb27975668c3db3dc78b66da8f 100644
--- a/utils/tests/archive/reader_test.dart
+++ b/utils/tests/archive/reader_test.dart
@@ -49,6 +49,23 @@ main() {
expect(future, completes);
});
+ test('reading a .tar.gz file with readAll', () {
+ var reader = new ArchiveReader();
+ reader.format.tar = true;
+ reader.filter.gzip = true;
+
+ var future = reader.openFilename("$dataPath/test-archive.tar.gz")
+ .chain((input) => input.readAll())
+ .transform((entries) {
+ entries = entries.map((entry) => [entry.pathname, entry.contents.trim()]);
+ expect(entries[0], orderedEquals(["filename1", "contents 1"]));
+ expect(entries[1], orderedEquals(["filename2", "contents 2"]));
+ expect(entries[2], orderedEquals(["filename3", "contents 3"]));
+ });
+
+ expect(future, completes);
+ });
+
test('reading an in-memory .tar.gz', () {
var asyncDone = expectAsync0(() {});

Powered by Google App Engine
This is Rietveld 408576698