Chromium Code Reviews

Side by Side Diff: test/io_test.dart

Issue 1556243002: Fix analyzer hints and warnings in test/. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 11 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/hosted/fail_gracefully_on_missing_package_test.dart ('k') | test/lock_file_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 library io_test; 5 library io_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
11 import 'package:pub/src/io.dart'; 11 import 'package:pub/src/io.dart';
12 import 'package:test/test.dart'; 12 import 'package:test/test.dart';
13 13
14 import 'test_pub.dart';
15
16 main() { 14 main() {
17 group('listDir', () { 15 group('listDir', () {
18 test('ignores hidden files by default', () { 16 test('ignores hidden files by default', () {
19 expect(withTempDir((temp) { 17 expect(withTempDir((temp) {
20 writeTextFile(path.join(temp, 'file1.txt'), ''); 18 writeTextFile(path.join(temp, 'file1.txt'), '');
21 writeTextFile(path.join(temp, 'file2.txt'), ''); 19 writeTextFile(path.join(temp, 'file2.txt'), '');
22 writeTextFile(path.join(temp, '.file3.txt'), ''); 20 writeTextFile(path.join(temp, '.file3.txt'), '');
23 createDir(path.join(temp, '.subdir')); 21 createDir(path.join(temp, '.subdir'));
24 writeTextFile(path.join(temp, '.subdir', 'file3.txt'), ''); 22 writeTextFile(path.join(temp, '.subdir', 'file3.txt'), '');
25 23
(...skipping 328 matching lines...)
354 expect(predicate(symlink2Path), equals(forMultiLevelFileSymlink)); 352 expect(predicate(symlink2Path), equals(forMultiLevelFileSymlink));
355 }), completes); 353 }), completes);
356 }); 354 });
357 } 355 }
358 }); 356 });
359 } 357 }
360 358
361 /// Like [withTempDir], but canonicalizes the path before passing it to [fn]. 359 /// Like [withTempDir], but canonicalizes the path before passing it to [fn].
362 Future withCanonicalTempDir(Future fn(String path)) => 360 Future withCanonicalTempDir(Future fn(String path)) =>
363 withTempDir((temp) => fn(canonicalize(temp))); 361 withTempDir((temp) => fn(canonicalize(temp)));
OLDNEW
« no previous file with comments | « test/hosted/fail_gracefully_on_missing_package_test.dart ('k') | test/lock_file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine