Index: sdk/lib/_internal/pub_generated/test/io_test.dart |
diff --git a/sdk/lib/_internal/pub/test/io_test.dart b/sdk/lib/_internal/pub_generated/test/io_test.dart |
similarity index 83% |
copy from sdk/lib/_internal/pub/test/io_test.dart |
copy to sdk/lib/_internal/pub_generated/test/io_test.dart |
index cc5d2c4d6124e3e38e1e6be34f34b99c96df9b32..056843fc6de462f67f892163be3b93b16693ee64 100644 |
--- a/sdk/lib/_internal/pub/test/io_test.dart |
+++ b/sdk/lib/_internal/pub_generated/test/io_test.dart |
@@ -25,10 +25,9 @@ main() { |
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') |
- ])); |
+ expect( |
+ listDir(temp, recursive: true), |
+ unorderedEquals([path.join(temp, 'file1.txt'), path.join(temp, 'file2.txt')])); |
}), completes); |
}); |
@@ -40,14 +39,15 @@ main() { |
createDir(path.join(temp, '.subdir')); |
writeTextFile(path.join(temp, '.subdir', 'file3.txt'), ''); |
- expect(listDir(temp, recursive: true, includeHidden: true), |
- unorderedEquals([ |
- path.join(temp, 'file1.txt'), |
- path.join(temp, 'file2.txt'), |
- path.join(temp, '.file3.txt'), |
- path.join(temp, '.subdir'), |
- path.join(temp, '.subdir', 'file3.txt') |
- ])); |
+ expect( |
+ listDir(temp, recursive: true, includeHidden: true), |
+ unorderedEquals( |
+ [ |
+ path.join(temp, 'file1.txt'), |
+ path.join(temp, 'file2.txt'), |
+ path.join(temp, '.file3.txt'), |
+ path.join(temp, '.subdir'), |
+ path.join(temp, '.subdir', 'file3.txt')])); |
}), completes); |
}); |
@@ -59,11 +59,13 @@ main() { |
writeTextFile(path.join(dir, 'file2.txt'), ''); |
writeTextFile(path.join(dir, 'file3.txt'), ''); |
- expect(listDir(dir, recursive: true), unorderedEquals([ |
- path.join(dir, 'file1.txt'), |
- path.join(dir, 'file2.txt'), |
- path.join(dir, 'file3.txt') |
- ])); |
+ expect( |
+ listDir(dir, recursive: true), |
+ unorderedEquals( |
+ [ |
+ path.join(dir, 'file1.txt'), |
+ path.join(dir, 'file2.txt'), |
+ path.join(dir, 'file3.txt')])); |
}), completes); |
}); |
}); |
@@ -79,7 +81,8 @@ main() { |
test('resolves a non-existent file', () { |
expect(withCanonicalTempDir((temp) { |
- expect(canonicalize(path.join(temp, 'nothing')), |
+ expect( |
+ canonicalize(path.join(temp, 'nothing')), |
equals(path.join(temp, 'nothing'))); |
}), completes); |
}); |
@@ -87,9 +90,7 @@ main() { |
test('resolves a symlink', () { |
expect(withCanonicalTempDir((temp) { |
createDir(path.join(temp, 'linked-dir')); |
- createSymlink( |
- path.join(temp, 'linked-dir'), |
- path.join(temp, 'dir')); |
+ createSymlink(path.join(temp, 'linked-dir'), path.join(temp, 'dir')); |
expect( |
canonicalize(path.join(temp, 'dir')), |
equals(path.join(temp, 'linked-dir'))); |
@@ -180,13 +181,14 @@ main() { |
createDir(dir); |
createSymlink(dir, subdir); |
expect( |
- canonicalize(path.join(temp, 'dir', 'subdir', 'subdir', 'subdir', |
- 'subdir', 'file')), |
+ canonicalize( |
+ path.join(temp, 'dir', 'subdir', 'subdir', 'subdir', 'subdir', 'file')), |
equals(path.join(dir, 'file'))); |
}), completes); |
}); |
- test('resolves a symlink that links to a path that needs more resolving', |
+ test( |
+ 'resolves a symlink that links to a path that needs more resolving', |
() { |
expect(withCanonicalTempDir((temp) { |
var dir = path.join(temp, 'dir'); |
@@ -195,9 +197,7 @@ main() { |
createDir(dir); |
createSymlink(dir, linkdir); |
createSymlink(path.join(linkdir, 'file'), linkfile); |
- expect( |
- canonicalize(linkfile), |
- equals(path.join(dir, 'file'))); |
+ expect(canonicalize(linkfile), equals(path.join(dir, 'file'))); |
}), completes); |
}); |
@@ -216,7 +216,9 @@ main() { |
}); |
}); |
- testExistencePredicate("entryExists", entryExists, |
+ testExistencePredicate( |
+ "entryExists", |
+ entryExists, |
forFile: true, |
forFileSymlink: true, |
forMultiLevelFileSymlink: true, |
@@ -226,7 +228,9 @@ main() { |
forBrokenSymlink: true, |
forMultiLevelBrokenSymlink: true); |
- testExistencePredicate("linkExists", linkExists, |
+ testExistencePredicate( |
+ "linkExists", |
+ linkExists, |
forFile: false, |
forFileSymlink: true, |
forMultiLevelFileSymlink: true, |
@@ -236,7 +240,9 @@ main() { |
forBrokenSymlink: true, |
forMultiLevelBrokenSymlink: true); |
- testExistencePredicate("fileExists", fileExists, |
+ testExistencePredicate( |
+ "fileExists", |
+ fileExists, |
forFile: true, |
forFileSymlink: true, |
forMultiLevelFileSymlink: true, |
@@ -246,7 +252,9 @@ main() { |
forBrokenSymlink: false, |
forMultiLevelBrokenSymlink: false); |
- testExistencePredicate("dirExists", dirExists, |
+ testExistencePredicate( |
+ "dirExists", |
+ dirExists, |
forFile: false, |
forFileSymlink: false, |
forMultiLevelFileSymlink: false, |
@@ -258,14 +266,9 @@ main() { |
} |
void testExistencePredicate(String name, bool predicate(String path), |
- {bool forFile, |
- bool forFileSymlink, |
- bool forMultiLevelFileSymlink, |
- bool forDirectory, |
- bool forDirectorySymlink, |
- bool forMultiLevelDirectorySymlink, |
- bool forBrokenSymlink, |
- bool forMultiLevelBrokenSymlink}) { |
+ {bool forFile, bool forFileSymlink, bool forMultiLevelFileSymlink, |
+ bool forDirectory, bool forDirectorySymlink, bool forMultiLevelDirectorySymlink, |
+ bool forBrokenSymlink, bool forMultiLevelBrokenSymlink}) { |
group(name, () { |
test('returns $forFile for a file', () { |
expect(withTempDir((temp) { |
@@ -293,8 +296,10 @@ void testExistencePredicate(String name, bool predicate(String path), |
}), completes); |
}); |
- test('returns $forMultiLevelDirectorySymlink for a multi-level symlink to ' |
- 'a directory', () { |
+ test( |
+ 'returns $forMultiLevelDirectorySymlink for a multi-level symlink to ' |
+ 'a directory', |
+ () { |
expect(withTempDir((temp) { |
var targetPath = path.join(temp, "dir"); |
var symlink1Path = path.join(temp, "link1dir"); |
@@ -302,8 +307,7 @@ void testExistencePredicate(String name, bool predicate(String path), |
createDir(targetPath); |
createSymlink(targetPath, symlink1Path); |
createSymlink(symlink1Path, symlink2Path); |
- expect(predicate(symlink2Path), |
- equals(forMultiLevelDirectorySymlink)); |
+ expect(predicate(symlink2Path), equals(forMultiLevelDirectorySymlink)); |
}), completes); |
}); |
@@ -318,7 +322,8 @@ void testExistencePredicate(String name, bool predicate(String path), |
}), completes); |
}); |
- test('returns $forMultiLevelBrokenSymlink for a multi-level broken symlink', |
+ test( |
+ 'returns $forMultiLevelBrokenSymlink for a multi-level broken symlink', |
() { |
expect(withTempDir((temp) { |
var targetPath = path.join(temp, "dir"); |
@@ -344,8 +349,9 @@ void testExistencePredicate(String name, bool predicate(String path), |
}), completes); |
}); |
- test('returns $forMultiLevelFileSymlink for a multi-level symlink to a ' |
- 'file', () { |
+ test( |
+ 'returns $forMultiLevelFileSymlink for a multi-level symlink to a ' 'file', |
+ () { |
expect(withTempDir((temp) { |
var targetPath = path.join(temp, "test.txt"); |
var symlink1Path = path.join(temp, "link1.txt"); |
@@ -362,4 +368,4 @@ void testExistencePredicate(String name, bool predicate(String path), |
/// Like [withTempDir], but canonicalizes the path before passing it to [fn]. |
Future withCanonicalTempDir(Future fn(String path)) => |
- withTempDir((temp) => fn(canonicalize(temp))); |
+ withTempDir((temp) => fn(canonicalize(temp))); |