From 8e8419b3a617b960e28cb67b06c29587c5b013c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Sun, 9 Aug 2020 23:44:28 +0200 Subject: [PATCH] Expect ZipEntry clean name test to be positive --- test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs b/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs index 1adebe2ab..cb2c72d16 100644 --- a/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs +++ b/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs @@ -286,7 +286,6 @@ public void WriteZipStreamWithNoCompression([Values(0, 1, 256)] int contentLengt [Test] [Category("Zip")] - [Category("KnownBugs")] public void ZipEntryFileNameAutoClean() { using (var dummyZip = Utils.GetDummyFile(0)) @@ -295,6 +294,7 @@ public void ZipEntryFileNameAutoClean() using (var zipOutputStream = new ZipOutputStream(zipFileStream)) using (var inputFileStream = File.OpenRead(inputFile.Filename)) { + // New ZipEntry created with a full file name path as it's name zipOutputStream.PutNextEntry(new ZipEntry(inputFile.Filename) { CompressionMethod = CompressionMethod.Stored, @@ -305,11 +305,9 @@ public void ZipEntryFileNameAutoClean() using (var zf = new ZipFile(dummyZip.Filename)) { - Assert.AreNotEqual(ZipEntry.CleanName(inputFile.Filename), zf[0].Name, - "Entry file name \"{0}\" WAS automatically cleaned, this test should be removed", inputFile.Filename); + // The ZipEntry name should have been automatically cleaned + Assert.AreEqual(ZipEntry.CleanName(inputFile.Filename), zf[0].Name); } - - Assert.Warn("Entry file name \"{0}\" was not automatically cleaned", inputFile.Filename); } }