Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3f800b2

Browse files
authored
Fix System.IO.Compression test (#19509)
* Fix System.IO.Compression test
1 parent 0218670 commit 3f800b2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/System.IO.Compression/tests/System.IO.Compression.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
2828
<Link>Common\System\AssertExtensions.cs</Link>
2929
</Compile>
30+
<Compile Include="$(CommonTestPath)\System\IO\PathFeatures.cs">
31+
<Link>Common\System\IO\PathFeatures.cs</Link>
32+
</Compile>
3033
<Compile Include="$(CommonTestPath)\System\IO\Compression\CRC.cs">
3134
<Link>Common\System\IO\Compression\CRC.cs</Link>
3235
</Compile>

src/System.IO.Compression/tests/ZipArchive/zip_ManualAndCompatibilityTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace System.IO.Compression.Tests
99
{
1010
public class zip_ManualAndCompatabilityTests : ZipFileTestBase
1111
{
12+
public static bool IsUsingNewPathNormalization => !PathFeatures.IsUsingLegacyPathNormalization();
13+
1214
[Theory]
1315
[InlineData("7zip.zip", "normal", true, true)]
1416
[InlineData("windows.zip", "normalWithoutEmptyDir", false, true)]
@@ -45,7 +47,7 @@ public static async Task CompatibilityTestsMsFiles(string withTrailing, string w
4547
/// For example, the file "aa\bb\cc\dd" in a zip created on Unix should be one file "aa\bb\cc\dd" whereas the same file
4648
/// in a zip created on Windows should be interpreted as the file "dd" underneath three subdirectories.
4749
/// </summary>
48-
[Theory]
50+
[ConditionalTheory(nameof(IsUsingNewPathNormalization))]
4951
[InlineData("backslashes_FromUnix.zip", "aa\\bb\\cc\\dd")]
5052
[InlineData("backslashes_FromWindows.zip", "dd")]
5153
[InlineData("WindowsInvalid_FromUnix.zip", "aa<b>d")]

0 commit comments

Comments
 (0)