提交 2d30bdc2 编写于 作者: I Ian Hays

Fix Filesystem tests failing from path changes

Changes in path validation disabled some of the FileSystem tests. Re-enable them with the new path logic in place.


Commit migrated from https://github.com/dotnet/corefx/commit/11d47f621e0064e5d6384486b4b4e4e02efb15e7
上级 5a4e9b62
......@@ -38,7 +38,12 @@ public void PathWithInvalidCharactersAsPath_ThrowsArgumentException()
var paths = IOInputs.GetPathsWithInvalidCharacters();
Assert.All(paths, (path) =>
{
Assert.Throws<ArgumentException>(() => Create(path));
if (path.Equals(@"\\?\"))
Assert.Throws<IOException>(() => Create(path));
else if (path.Contains(@"\\?\"))
Assert.Throws<DirectoryNotFoundException>(() => Create(path));
else
Assert.Throws<ArgumentException>(() => Create(path));
});
}
......
......@@ -50,7 +50,10 @@ public void PathWithIllegalCharacters()
testFile.Create().Dispose();
Assert.All(IOInputs.GetPathsWithInvalidCharacters(), (invalid) =>
{
Assert.Throws<ArgumentException>(() => Move(testFile.FullName, invalid));
if (invalid.Contains(@"\\?\"))
Assert.Throws<IOException>(() => Move(testFile.FullName, invalid));
else
Assert.Throws<ArgumentException>(() => Move(testFile.FullName, invalid));
});
}
......
......@@ -180,11 +180,9 @@ public static IEnumerable<string> GetPathsWithInvalidCharacters()
yield return "\0";
yield return "middle\0path";
yield return "trailing\0";
// TODO: #6931 Add these back in some fashion
//yield return @"\\?\";
//yield return @"\\?\UNC\";
//yield return @"\\?\UNC\LOCALHOST";
yield return @"\\?\";
yield return @"\\?\UNC\";
yield return @"\\?\UNC\LOCALHOST";
}
else
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册