|
1 | 1 | using System; |
2 | | -using System.Collections.Generic; |
3 | 2 | using System.IO; |
4 | | -using AnakinRaW.CommonUtilities.FileSystem; |
5 | 3 | using Xunit; |
| 4 | +#if NETFRAMEWORK |
| 5 | +using AnakinRaW.CommonUtilities.FileSystem; |
| 6 | +#endif |
6 | 7 |
|
7 | 8 | namespace PG.StarWarsGame.Engine.FileSystem.Test.IO; |
8 | 9 |
|
@@ -34,34 +35,6 @@ public void GetFileName_Span(string path, string expected) |
34 | 35 | Assert.Equal(expected, _pgFileSystem.GetFileName(path)); |
35 | 36 | } |
36 | 37 |
|
37 | | - public static IEnumerable<object[]> TestData_GetFileName_Volume() |
38 | | - { |
39 | | - yield return [":", ":"]; |
40 | | - yield return [".:", ".:"]; |
41 | | - yield return [".:.", ".:."]; // Not a valid drive letter |
42 | | - yield return ["file:", "file:"]; |
43 | | - yield return [":file", ":file"]; |
44 | | - yield return ["file:exe", "file:exe"]; |
45 | | - yield return ["baz\\file:exe", "file:exe"]; |
46 | | - yield return ["bar/baz/file:exe", "file:exe"]; |
47 | | - } |
48 | | - |
49 | | - [Theory, MemberData(nameof(TestData_GetFileName_Volume))] |
50 | | - public void GetFileName_Volume(string path, string expected) |
51 | | - { |
52 | | - // We used to break on ':' on Windows. This is a valid file name character for alternate data streams. |
53 | | - // Additionally, the character can show up on unix volumes mounted to Windows. |
54 | | -#if !NETFRAMEWORK |
55 | | - Assert.Equal(expected, Path.GetFileName(path)); |
56 | | - Assert.Equal(expected, _pgFileSystem.GetFileName(path)); |
57 | | -#if Windows |
58 | | - Assert.Equal(_pgFileSystem.GetFileName(path), _fileSystem.Path.GetFileName(path.AsSpan())); |
59 | | -#endif |
60 | | -#endif |
61 | | - |
62 | | - PathAssert.Equal(expected.AsSpan(), _pgFileSystem.GetFileName(path.AsSpan())); |
63 | | - } |
64 | | - |
65 | 38 | public static TheoryData<string, string> TestData_GetFileNameWithoutExtension => new() |
66 | 39 | { |
67 | 40 | { "", "" }, |
|
0 commit comments