66import 'dart:io' as io;
77
88import 'package:file/local.dart' ;
9+ import 'package:file/src/testing/internal.dart' ;
910import 'package:test/test.dart' ;
1011
1112import 'common_tests.dart' ;
@@ -29,89 +30,50 @@ void main() {
2930 tmp.deleteSync (recursive: true );
3031 });
3132
33+ setUpAll (() {
34+ if (io.Platform .isWindows) {
35+ // TODO(tvolkert): Remove once all more serious test failures are fixed
36+ // https://github.com/google/file.dart/issues/56
37+ ignoreOsErrorCodes = true ;
38+ }
39+ });
40+
41+ tearDownAll (() {
42+ ignoreOsErrorCodes = false ;
43+ });
44+
3245 Map <String , List <String >> skipOnPlatform = < String , List <String >> {
3346 'windows' : < String > [
3447 'FileSystem > currentDirectory > throwsIfHasNonExistentPathInComplexChain' ,
3548 'FileSystem > currentDirectory > staysAtRootIfSetToParentOfRoot' ,
36- 'FileSystem > currentDirectory > throwsIfSetToFilePathSegmentAtTail' ,
37- 'FileSystem > currentDirectory > throwsIfSetToFilePathSegmentViaTraversal' ,
3849 'FileSystem > currentDirectory > resolvesLinksIfEncountered' ,
3950 'FileSystem > currentDirectory > succeedsIfSetToDirectoryLinkAtTail' ,
40- 'FileSystem > currentDirectory > throwsIfSetToLinkLoop' ,
4151 'FileSystem > stat > isFileForLinkToFile' ,
4252 'FileSystem > type > isFileForLinkToFileAndFollowLinksTrue' ,
4353 'FileSystem > type > isNotFoundForLinkWithCircularReferenceAndFollowLinksTrue' ,
4454 'Directory > uri' ,
4555 'Directory > exists > falseIfExistsAsLinkToFile' ,
4656 'Directory > exists > falseIfNotFoundSegmentExistsThenIsBackedOut' ,
47- 'Directory > create > throwsIfAlreadyExistsAsFile' ,
4857 'Directory > create > throwsIfAlreadyExistsAsLinkToFile' ,
49- 'Directory > create > throwsIfAlreadyExistsAsLinkToNotFoundViaTraversal' ,
50- 'Directory > create > throwsIfAncestorDoesntExistRecursiveFalse' ,
51- 'Directory > rename > throwsIfDestinationIsFile' ,
52- 'Directory > rename > throwsIfDestinationParentFolderDoesntExist' ,
5358 'Directory > rename > throwsIfDestinationIsNonEmptyDirectory' ,
54- 'Directory > rename > throwsIfSourceIsFile' ,
55- 'Directory > rename > throwsIfDestinationIsLinkToNotFound' ,
5659 'Directory > rename > throwsIfDestinationIsLinkToEmptyDirectory' ,
57- 'Directory > delete > throwsIfNonEmptyDirectoryExistsAndRecursiveFalse' ,
58- 'Directory > delete > throwsIfPathReferencesFileAndRecursiveFalse' ,
5960 'Directory > delete > throwsIfPathReferencesLinkToFileAndRecursiveFalse' ,
60- 'Directory > delete > throwsIfPathReferencesLinkToNotFoundAndRecursiveFalse' ,
61- 'Directory > resolveSymbolicLinks > throwsIfLoopInLinkChain' ,
62- 'Directory > resolveSymbolicLinks > throwsIfPathNotFoundInTraversal' ,
6361 'Directory > resolveSymbolicLinks > throwsIfPathNotFoundInMiddleThenBackedOut' ,
64- 'Directory > createTemp > throwsIfDirectoryDoesntExist' ,
6562 'Directory > createTemp > succeedsWithNestedPathPrefixThatExists' ,
66- 'Directory > createTemp > throwsWithNestedPathPrefixThatDoesntExist' ,
67- 'Directory > list > throwsIfDirectoryDoesntExist' ,
6863 'Directory > list > followsLinksIfFollowLinksTrue' ,
6964 'Directory > list > returnsLinkObjectsForRecursiveLinkIfFollowLinksTrue' ,
7065 'File > uri' ,
71- 'File > create > throwsIfAncestorDoesntExistRecursiveFalse' ,
7266 'File > create > succeedsIfAlreadyExistsAsLinkToFile' ,
7367 'File > create > succeedsIfAlreadyExistsAsLinkToNotFoundAtTail' ,
74- 'File > create > throwsIfAlreadyExistsAsLinkToNotFoundViaTraversal' ,
7568 'File > create > succeedsIfAlreadyExistsAsLinkToNotFoundInDifferentDirectory' ,
76- 'File > rename > throwsIfDestinationDoesntExistViaTraversal' ,
77- 'File > rename > throwsIfDestinationExistsAsDirectory' ,
7869 'File > rename > succeedsIfDestinationExistsAsLinkToFile' ,
7970 'File > rename > succeedsIfDestinationExistsAsLinkToNotFound' ,
80- 'File > rename > throwsIfSourceExistsAsDirectory' ,
8171 'File > rename > succeedsIfSourceExistsAsLinkToFile' ,
82- 'File > rename > throwsIfSourceExistsAsLinkToDirectory' ,
83- 'File > copy > throwsIfDestinationDoesntExistViaTraversal' ,
84- 'File > copy > throwsIfDestinationExistsAsDirectory' ,
8572 'File > copy > succeedsIfDestinationExistsAsLinkToFile' ,
86- 'File > copy > throwsIfDestinationExistsAsLinkToDirectory' ,
87- 'File > copy > throwsIfSourceExistsAsDirectory' ,
8873 'File > copy > succeedsIfSourceExistsAsLinkToFile' ,
8974 'File > copy > succeedsIfSourceIsLinkToFileInDifferentDirectory' ,
9075 'File > copy > succeedsIfDestinationIsLinkToFileInDifferentDirectory' ,
91- 'File > open > READ > throwsIfDoesntExistViaTraversal' ,
92- 'File > open > READ > RandomAccessFile > throwsIfWriteByte' ,
93- 'File > open > READ > RandomAccessFile > throwsIfWriteFrom' ,
94- 'File > open > READ > RandomAccessFile > throwsIfWriteString' ,
95- 'File > open > READ > RandomAccessFile > position > throwsIfSetToNegativeNumber' ,
96- 'File > open > READ > RandomAccessFile > throwsIfTruncate' ,
97- 'File > open > WRITE > throwsIfDoesntExistViaTraversal' ,
98- 'File > open > WRITE > RandomAccessFile > position > throwsIfSetToNegativeNumber' ,
99- 'File > open > APPEND > throwsIfDoesntExistViaTraversal' ,
100- 'File > open > APPEND > RandomAccessFile > position > throwsIfSetToNegativeNumber' ,
101- 'File > open > WRITE_ONLY > throwsIfDoesntExistViaTraversal' ,
102- 'File > open > WRITE_ONLY > RandomAccessFile > throwsIfReadByte' ,
103- 'File > open > WRITE_ONLY > RandomAccessFile > throwsIfRead' ,
104- 'File > open > WRITE_ONLY > RandomAccessFile > throwsIfReadInto' ,
105- 'File > open > WRITE_ONLY > RandomAccessFile > position > throwsIfSetToNegativeNumber' ,
106- 'File > open > WRITE_ONLY_APPEND > throwsIfDoesntExistViaTraversal' ,
107- 'File > open > WRITE_ONLY_APPEND > RandomAccessFile > throwsIfReadByte' ,
108- 'File > open > WRITE_ONLY_APPEND > RandomAccessFile > throwsIfRead' ,
109- 'File > open > WRITE_ONLY_APPEND > RandomAccessFile > throwsIfReadInto' ,
110- 'File > open > WRITE_ONLY_APPEND > RandomAccessFile > position > throwsIfSetToNegativeNumber' ,
111- 'File > openRead > throwsIfExistsAsDirectory' ,
11276 'File > openRead > succeedsIfExistsAsLinkToFile' ,
113- 'File > openWrite > throwsIfExistsAsDirectory' ,
114- 'File > openWrite > throwsIfExistsAsLinkToDirectory' ,
11577 'File > openWrite > succeedsIfExistsAsLinkToFile' ,
11678 'File > openWrite > ioSink > throwsIfEncodingIsNullAndWriteObject' ,
11779 'File > openWrite > ioSink > allowsChangingEncoding' ,
@@ -127,48 +89,19 @@ void main() {
12789 'File > openWrite > ioSink > addStream > blocksCallToWriteCharCodeWhileStreamIsActive' ,
12890 'File > openWrite > ioSink > addStream > blocksCallToWritelnWhileStreamIsActive' ,
12991 'File > openWrite > ioSink > addStream > blocksCallToFlushWhileStreamIsActive' ,
130- 'File > readAsBytes > throwsIfExistsAsDirectory' ,
131- 'File > readAsBytes > throwsIfExistsAsLinkToDirectory' ,
13292 'File > readAsBytes > succeedsIfExistsAsLinkToFile' ,
133- 'File > readAsString > throwsIfExistsAsDirectory' ,
134- 'File > readAsString > throwsIfExistsAsLinkToDirectory' ,
13593 'File > readAsString > succeedsIfExistsAsLinkToFile' ,
136- 'File > readAsLines > throwsIfExistsAsDirectory' ,
137- 'File > readAsLines > throwsIfExistsAsLinkToDirectory' ,
138- 'File > writeAsBytes > throwsIfExistsAsDirectory' ,
139- 'File > writeAsBytes > throwsIfExistsAsLinkToDirectory' ,
14094 'File > writeAsBytes > succeedsIfExistsAsLinkToFile' ,
141- 'File > writeAsBytes > throwsIfFileModeRead' ,
142- 'File > writeAsString > throwsIfExistsAsDirectory' ,
143- 'File > writeAsString > throwsIfExistsAsLinkToDirectory' ,
14495 'File > writeAsString > succeedsIfExistsAsLinkToFile' ,
145- 'File > writeAsString > throwsIfFileModeRead' ,
14696 'File > stat > isFileIfExistsAsLinkToFile' ,
147- 'File > delete > throwsIfExistsAsDirectoryAndRecursiveFalse' ,
14897 'File > delete > succeedsIfExistsAsLinkToFileAndRecursiveFalse' ,
149- 'File > delete > throwsIfExistsAsLinkToDirectoryAndRecursiveFalse' ,
15098 'Link > uri > whenTargetIsDirectory' ,
15199 'Link > uri > whenTargetIsFile' ,
152100 'Link > uri > whenLinkDoesntExist' ,
153101 'Link > stat > isFileIfTargetIsFile' ,
154102 'Link > stat > isDirectoryIfTargetIsDirectory' ,
155- 'Link > delete > throwsIfPathReferencesFileAndRecursiveFalse' ,
156- 'Link > delete > throwsIfPathReferencesDirectoryAndRecursiveFalse' ,
157- 'Link > create > throwsIfLinkDoesntExistViaTraversalAndRecursiveFalse' ,
158103 'Link > create > succeedsIfLinkDoesntExistViaTraversalAndRecursiveTrue' ,
159- 'Link > create > throwsIfAlreadyExistsAsFile' ,
160- 'Link > create > throwsIfAlreadyExistsAsDirectory' ,
161- 'Link > create > throwsIfAlreadyExistsWithSameTarget' ,
162- 'Link > create > throwsIfAlreadyExistsWithDifferentTarget' ,
163- 'Link > update > throwsIfPathReferencesFile' ,
164- 'Link > update > throwsIfPathReferencesDirectory' ,
165- 'Link > target > throwsIfLinkDoesntExistViaTraversal' ,
166- 'Link > target > throwsIfPathReferencesFile' ,
167- 'Link > target > throwsIfPathReferencesDirectory' ,
168104 'Link > rename > returnsCovariantType' ,
169- 'Link > rename > throwsIfSourceIsFile' ,
170- 'Link > rename > throwsIfSourceIsDirectory' ,
171- 'Link > rename > throwsIfDestinationDoesntExistViaTraversal' ,
172105 'Link > rename > succeedsIfDestinationExistsAsLinkToFile' ,
173106 'Link > rename > throwsIfDestinationExistsAsLinkToDirectory' ,
174107 'Link > rename > succeedsIfDestinationExistsAsLinkToNotFound' ,
0 commit comments