mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-08 18:16:30 +00:00
fix tests
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using SharpCompress.Common;
|
||||
|
||||
namespace SharpCompress.IO;
|
||||
|
||||
internal class MarkingBinaryReader : BinaryReader
|
||||
internal class MarkingBinaryReader(Stream stream)
|
||||
: BinaryReader(stream, Encoding.UTF8, leaveOpen: true) //always leave the stream open
|
||||
{
|
||||
public MarkingBinaryReader(Stream stream)
|
||||
: base(stream) { }
|
||||
|
||||
public virtual long CurrentReadByteCount { get; protected set; }
|
||||
|
||||
public virtual void Mark() => CurrentReadByteCount = 0;
|
||||
|
||||
@@ -43,11 +43,9 @@ public class TarArchiveAsyncTests : ArchiveTests
|
||||
)
|
||||
using (Stream inputStream = new MemoryStream())
|
||||
{
|
||||
using (var sw = new StreamWriter(inputStream))
|
||||
{
|
||||
await sw.WriteAsync("dummy filecontent");
|
||||
await sw.FlushAsync();
|
||||
}
|
||||
var sw = new StreamWriter(inputStream);
|
||||
await sw.WriteAsync("dummy filecontent");
|
||||
await sw.FlushAsync();
|
||||
|
||||
inputStream.Position = 0;
|
||||
await writer.WriteAsync(filename, inputStream, null);
|
||||
@@ -104,11 +102,9 @@ public class TarArchiveAsyncTests : ArchiveTests
|
||||
)
|
||||
using (Stream inputStream = new MemoryStream())
|
||||
{
|
||||
using (var sw = new StreamWriter(inputStream))
|
||||
{
|
||||
await sw.WriteAsync("dummy filecontent");
|
||||
await sw.FlushAsync();
|
||||
}
|
||||
var sw = new StreamWriter(inputStream);
|
||||
await sw.WriteAsync("dummy filecontent");
|
||||
await sw.FlushAsync();
|
||||
|
||||
inputStream.Position = 0;
|
||||
await writer.WriteAsync(longFilename, inputStream, null);
|
||||
|
||||
@@ -54,11 +54,9 @@ public class TarArchiveTests : ArchiveTests
|
||||
)
|
||||
using (Stream inputStream = new MemoryStream())
|
||||
{
|
||||
using (var sw = new StreamWriter(inputStream))
|
||||
{
|
||||
sw.Write("dummy filecontent");
|
||||
sw.Flush();
|
||||
}
|
||||
var sw = new StreamWriter(inputStream);
|
||||
sw.Write("dummy filecontent");
|
||||
sw.Flush();
|
||||
|
||||
inputStream.Position = 0;
|
||||
writer.Write(filename, inputStream, null);
|
||||
@@ -122,11 +120,9 @@ public class TarArchiveTests : ArchiveTests
|
||||
)
|
||||
using (Stream inputStream = new MemoryStream())
|
||||
{
|
||||
using (var sw = new StreamWriter(inputStream))
|
||||
{
|
||||
sw.Write("dummy filecontent");
|
||||
sw.Flush();
|
||||
}
|
||||
var sw = new StreamWriter(inputStream);
|
||||
sw.Write("dummy filecontent");
|
||||
sw.Flush();
|
||||
|
||||
inputStream.Position = 0;
|
||||
writer.Write(longFilename, inputStream, null);
|
||||
|
||||
Reference in New Issue
Block a user