You've already forked linux-packaging-mono
Imported Upstream version 4.4.0.40
Former-commit-id: 6427cc082e74df30afc535fd906a3494b74b0817
This commit is contained in:
@@ -114,6 +114,51 @@ namespace MonoTests.System.IO.Compression
|
||||
File.Delete ("test.zip");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ZipOpenAndReopenEntry()
|
||||
{
|
||||
try {
|
||||
File.Copy("archive.zip", "test.zip", overwrite: true);
|
||||
using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
|
||||
ZipArchiveMode.Update))
|
||||
{
|
||||
var entry = archive.GetEntry("foo.txt");
|
||||
Assert.IsNotNull(entry);
|
||||
|
||||
var stream = entry.Open();
|
||||
|
||||
try {
|
||||
stream = entry.Open();
|
||||
} catch (global::System.IO.IOException ex) {
|
||||
return;
|
||||
}
|
||||
|
||||
Assert.Fail();
|
||||
}
|
||||
} finally {
|
||||
File.Delete ("test.zip");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ZipOpenCloseAndReopenEntry()
|
||||
{
|
||||
File.Copy("archive.zip", "test.zip", overwrite: true);
|
||||
using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
|
||||
ZipArchiveMode.Update))
|
||||
{
|
||||
var entry = archive.GetEntry("foo.txt");
|
||||
Assert.IsNotNull(entry);
|
||||
|
||||
var stream = entry.Open();
|
||||
stream.Dispose();
|
||||
stream = entry.Open();
|
||||
}
|
||||
|
||||
File.Delete ("test.zip");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ZipGetEntryDeleteReadMode()
|
||||
{
|
||||
|
Reference in New Issue
Block a user