Skip to content

Commit 6dd808f

Browse files
authored
[release/6.0] Fix long directory path test (#64955)
1 parent 5e65919 commit 6dd808f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libraries/System.IO.FileSystem/tests/Directory/CreateDirectory.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ public void DirectoryLongerThanMaxLongPathWithExtendedSyntax_ThrowsException()
270270
{
271271
var paths = IOInputs.GetPathsLongerThanMaxLongPath(GetTestFilePath(), useExtendedSyntax: true);
272272

273+
// Ideally this should be PathTooLongException or DirectoryNotFoundException but on some machines
274+
// windows gives us ERROR_INVALID_NAME, producing IOException.
273275
Assert.All(paths, path =>
274-
AssertExtensions.ThrowsAny<PathTooLongException, DirectoryNotFoundException>(() => Create(path)));
276+
AssertExtensions.ThrowsAny<PathTooLongException, DirectoryNotFoundException, IOException>(() => Create(path)));
275277
}
276278

277279
[ConditionalFact(nameof(LongPathsAreNotBlocked), nameof(UsingNewNormalization))]

0 commit comments

Comments
 (0)