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

Unified Diff: sdk/lib/_internal/pub/test/io_test.dart

Issue 211373003: Speed up directory listing in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 9 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
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/io_test.dart
diff --git a/sdk/lib/_internal/pub/test/io_test.dart b/sdk/lib/_internal/pub/test/io_test.dart
index bc8d708afb0a0e8ec4c592e21cafd3e96639119c..a3d7b0e8920522cc51c11f5501f09f6c219adde9 100644
--- a/sdk/lib/_internal/pub/test/io_test.dart
+++ b/sdk/lib/_internal/pub/test/io_test.dart
@@ -17,37 +17,6 @@ main() {
initConfig();
group('listDir', () {
- test('lists a simple directory non-recursively', () {
- expect(withTempDir((temp) {
- writeTextFile(path.join(temp, 'file1.txt'), '');
- writeTextFile(path.join(temp, 'file2.txt'), '');
- createDir(path.join(temp, 'subdir'));
- writeTextFile(path.join(temp, 'subdir', 'file3.txt'), '');
-
- expect(listDir(temp), unorderedEquals([
- path.join(temp, 'file1.txt'),
- path.join(temp, 'file2.txt'),
- path.join(temp, 'subdir')
- ]));
- }), completes);
- });
-
- test('lists a simple directory recursively', () {
- expect(withTempDir((temp) {
- writeTextFile(path.join(temp, 'file1.txt'), '');
- writeTextFile(path.join(temp, 'file2.txt'), '');
- createDir(path.join(temp, 'subdir'));
- writeTextFile(path.join(temp, 'subdir', 'file3.txt'), '');
-
- expect(listDir(temp, recursive: true), unorderedEquals([
- path.join(temp, 'file1.txt'),
- path.join(temp, 'file2.txt'),
- path.join(temp, 'subdir'),
- path.join(temp, 'subdir', 'file3.txt'),
- ]));
- }), completes);
- });
-
test('ignores hidden files by default', () {
expect(withTempDir((temp) {
writeTextFile(path.join(temp, 'file1.txt'), '');
@@ -81,58 +50,6 @@ main() {
]));
}), completes);
});
-
- test('returns the unresolved paths for symlinks', () {
- expect(withTempDir((temp) {
- var dirToList = path.join(temp, 'dir-to-list');
- createDir(path.join(temp, 'dir1'));
- writeTextFile(path.join(temp, 'dir1', 'file1.txt'), '');
- createDir(path.join(temp, 'dir2'));
- writeTextFile(path.join(temp, 'dir2', 'file2.txt'), '');
- createDir(dirToList);
- createSymlink(
- path.join(temp, 'dir1'),
- path.join(dirToList, 'linked-dir1'));
- createDir(path.join(dirToList, 'subdir'));
- createSymlink(
- path.join(temp, 'dir2'),
- path.join(dirToList, 'subdir', 'linked-dir2'));
-
- expect(listDir(dirToList, recursive: true), unorderedEquals([
- path.join(dirToList, 'linked-dir1'),
- path.join(dirToList, 'linked-dir1', 'file1.txt'),
- path.join(dirToList, 'subdir'),
- path.join(dirToList, 'subdir', 'linked-dir2'),
- path.join(dirToList, 'subdir', 'linked-dir2', 'file2.txt'),
- ]));
- }), completes);
- });
-
- test('works with recursive symlinks', () {
- expect(withTempDir((temp) {
- writeTextFile(path.join(temp, 'file1.txt'), '');
- createSymlink(temp, path.join(temp, 'linkdir'));
-
- expect(listDir(temp, recursive: true), unorderedEquals([
- path.join(temp, 'file1.txt'),
- path.join(temp, 'linkdir')
- ]));
- }), completes);
- });
-
- test('treats a broken symlink as a file', () {
- expect(withTempDir((temp) {
- writeTextFile(path.join(temp, 'file1.txt'), '');
- createDir(path.join(temp, 'dir'));
- createSymlink(path.join(temp, 'dir'), path.join(temp, 'linkdir'));
- deleteEntry(path.join(temp, 'dir'));
-
- expect(listDir(temp, recursive: true), unorderedEquals([
- path.join(temp, 'file1.txt'),
- path.join(temp, 'linkdir')
- ]));
- }), completes);
- });
});
group('canonicalize', () {
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698