Chromium Code Reviews

Side by Side Diff: test/descriptor/tar.dart

Issue 1153643002: Use "package:" imports for pub. (Closed) Base URL: git@github.com:dart-lang/pub_test@master
Patch Set: Code review changes Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « test/descriptor/git.dart ('k') | test/downgrade/dry_run_does_not_apply_changes_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 library descriptor.tar; 5 library descriptor.tar;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:path/path.dart' as path; 9 import 'package:path/path.dart' as path;
10 import 'package:pub/src/io.dart';
10 import 'package:scheduled_test/scheduled_test.dart'; 11 import 'package:scheduled_test/scheduled_test.dart';
11 import 'package:scheduled_test/descriptor.dart'; 12 import 'package:scheduled_test/descriptor.dart';
12 13
13 import '../../lib/src/io.dart';
14 14
15 /// Describes a tar file and its contents. 15 /// Describes a tar file and its contents.
16 class TarFileDescriptor extends DirectoryDescriptor 16 class TarFileDescriptor extends DirectoryDescriptor
17 implements ReadableDescriptor { 17 implements ReadableDescriptor {
18 TarFileDescriptor(String name, List<Descriptor> contents) 18 TarFileDescriptor(String name, List<Descriptor> contents)
19 : super(name, contents); 19 : super(name, contents);
20 20
21 /// Creates the files and directories within this tar file, then archives 21 /// Creates the files and directories within this tar file, then archives
22 /// them, compresses them, and saves the result to [parentDir]. 22 /// them, compresses them, and saves the result to [parentDir].
23 Future<String> create([String parent]) => schedule(() { 23 Future<String> create([String parent]) => schedule(() {
(...skipping 20 matching lines...)
44 throw new UnimplementedError("TODO(nweiz): implement this"); 44 throw new UnimplementedError("TODO(nweiz): implement this");
45 } 45 }
46 46
47 Stream<List<int>> read() { 47 Stream<List<int>> read() {
48 return new Stream<List<int>>.fromFuture(withTempDir((tempDir) { 48 return new Stream<List<int>>.fromFuture(withTempDir((tempDir) {
49 return create(tempDir).then((_) => 49 return create(tempDir).then((_) =>
50 readBinaryFile(path.join(tempDir, name))); 50 readBinaryFile(path.join(tempDir, name)));
51 })); 51 }));
52 } 52 }
53 } 53 }
OLDNEW
« no previous file with comments | « test/descriptor/git.dart ('k') | test/downgrade/dry_run_does_not_apply_changes_test.dart » ('j') | no next file with comments »

Powered by Google App Engine