Skip to content

Commit 96b4d86

Browse files
authored
PR #505: Expect ZipEntry clean name test to be positive
1 parent 33ab19b commit 96b4d86

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ public void WriteZipStreamWithNoCompression([Values(0, 1, 256)] int contentLengt
286286

287287
[Test]
288288
[Category("Zip")]
289-
[Category("KnownBugs")]
290289
public void ZipEntryFileNameAutoClean()
291290
{
292291
using (var dummyZip = Utils.GetDummyFile(0))
@@ -295,6 +294,7 @@ public void ZipEntryFileNameAutoClean()
295294
using (var zipOutputStream = new ZipOutputStream(zipFileStream))
296295
using (var inputFileStream = File.OpenRead(inputFile.Filename))
297296
{
297+
// New ZipEntry created with a full file name path as it's name
298298
zipOutputStream.PutNextEntry(new ZipEntry(inputFile.Filename)
299299
{
300300
CompressionMethod = CompressionMethod.Stored,
@@ -305,11 +305,9 @@ public void ZipEntryFileNameAutoClean()
305305

306306
using (var zf = new ZipFile(dummyZip.Filename))
307307
{
308-
Assert.AreNotEqual(ZipEntry.CleanName(inputFile.Filename), zf[0].Name,
309-
"Entry file name \"{0}\" WAS automatically cleaned, this test should be removed", inputFile.Filename);
308+
// The ZipEntry name should have been automatically cleaned
309+
Assert.AreEqual(ZipEntry.CleanName(inputFile.Filename), zf[0].Name);
310310
}
311-
312-
Assert.Warn("Entry file name \"{0}\" was not automatically cleaned", inputFile.Filename);
313311
}
314312
}
315313

0 commit comments

Comments
 (0)