forked from KSP-CKAN/CKAN
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test showing presence of SharpZipLib bug.
Part of GH KSP-CKAN#221.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using NUnit.Framework; | ||
using ICSharpCode.SharpZipLib.Zip; | ||
using System.IO; | ||
using System; | ||
|
||
namespace Tests | ||
{ | ||
[TestFixture()] | ||
public class ZipLib | ||
{ | ||
[Test()] | ||
public void GH221() | ||
{ | ||
// This is a perfectly fine file, written by 'file-roller', but | ||
// SharpZipLib can choke on it because it's not properly handling | ||
// the headers properly. See GH #221. | ||
string file = Path.Combine(TestData.DataDir(), "gh221.zip"); | ||
|
||
var zipfile = new ZipFile(file); | ||
|
||
var entry = zipfile.GetEntry("221.txt"); | ||
|
||
string version = string.Format("{0}", entry.Version); | ||
|
||
Assert.DoesNotThrow(delegate | ||
{ | ||
zipfile.GetInputStream(entry); | ||
}, "zip-entry format {0} (788 is our bug)", version); | ||
} | ||
} | ||
} | ||
|
Binary file not shown.