mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
force async tests
This commit is contained in:
@@ -391,7 +391,7 @@ public class ArchiveTests : ReaderTests
|
||||
{
|
||||
writerOptions.CompressionLevel = compressionLevel.Value;
|
||||
}
|
||||
return WriterFactory.OpenAsync(stream, ArchiveType.Zip, writerOptions);
|
||||
return WriterFactory.OpenAsync(new AsyncOnlyStream(stream), ArchiveType.Zip, writerOptions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Test.Mocks;
|
||||
using SharpCompress.Writers;
|
||||
using SharpCompress.Writers.GZip;
|
||||
using Xunit;
|
||||
@@ -22,7 +23,7 @@ public class GZipWriterAsyncTests : WriterTests
|
||||
FileAccess.Write
|
||||
)
|
||||
)
|
||||
using (var writer = WriterFactory.OpenAsync(stream, ArchiveType.GZip, CompressionType.GZip))
|
||||
using (var writer = WriterFactory.OpenAsync(new AsyncOnlyStream(stream), ArchiveType.GZip, CompressionType.GZip))
|
||||
{
|
||||
await writer.WriteAsync("Tar.tar", Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar"));
|
||||
}
|
||||
@@ -42,7 +43,7 @@ public class GZipWriterAsyncTests : WriterTests
|
||||
FileAccess.Write
|
||||
)
|
||||
)
|
||||
using (var writer = new GZipWriter(stream))
|
||||
using (var writer = new GZipWriter(new AsyncOnlyStream(stream)))
|
||||
{
|
||||
await writer.WriteAsync("Tar.tar", Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar"));
|
||||
}
|
||||
@@ -57,7 +58,7 @@ public class GZipWriterAsyncTests : WriterTests
|
||||
Assert.Throws<InvalidFormatException>(() =>
|
||||
{
|
||||
using Stream stream = File.OpenWrite(Path.Combine(SCRATCH_FILES_PATH, "Tar.tar.gz"));
|
||||
using var writer = WriterFactory.Open(stream, ArchiveType.GZip, CompressionType.BZip2);
|
||||
using var writer = WriterFactory.Open(new AsyncOnlyStream(stream), ArchiveType.GZip, CompressionType.BZip2);
|
||||
});
|
||||
|
||||
[Fact]
|
||||
@@ -70,7 +71,7 @@ public class GZipWriterAsyncTests : WriterTests
|
||||
FileAccess.Write
|
||||
)
|
||||
)
|
||||
using (var writer = new GZipWriter(stream))
|
||||
using (var writer = new GZipWriter(new AsyncOnlyStream(stream)))
|
||||
{
|
||||
var path = Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar");
|
||||
await writer.WriteAsync(path, path);
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Test.Mocks;
|
||||
using SharpCompress.Writers.Tar;
|
||||
using Xunit;
|
||||
|
||||
@@ -66,7 +67,7 @@ public class TarWriterAsyncTests : WriterTests
|
||||
using Stream content = File.OpenRead(Path.Combine(ORIGINAL_FILES_PATH, "jpg", "test.jpg"));
|
||||
using (
|
||||
var writer = new TarWriter(
|
||||
stream,
|
||||
new AsyncOnlyStream(stream),
|
||||
new TarWriterOptions(CompressionType.None, finalizeArchive)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user