Restore the tests of the FileOutput stream
This commit is contained in:
parent
49eb9a10d3
commit
9da65e792e
1 changed files with 5 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ suite "output stream":
|
||||||
var memStream = OutputStream.init
|
var memStream = OutputStream.init
|
||||||
var altOutput: seq[byte] = @[]
|
var altOutput: seq[byte] = @[]
|
||||||
var tempFilePath = getTempDir() / "faststreams_testfile"
|
var tempFilePath = getTempDir() / "faststreams_testfile"
|
||||||
# var fileStream = OutputStream.init tempFilePath
|
var fileStream = OutputStream.init tempFilePath
|
||||||
|
|
||||||
const bufferSize = 1000000
|
const bufferSize = 1000000
|
||||||
var buffer = alloc(bufferSize)
|
var buffer = alloc(bufferSize)
|
||||||
|
|
@ -37,14 +37,14 @@ suite "output stream":
|
||||||
altOutput.add bytes(val)
|
altOutput.add bytes(val)
|
||||||
|
|
||||||
memStream.append val
|
memStream.append val
|
||||||
# fileStream.append val
|
fileStream.append val
|
||||||
existingBufferStream.append val
|
existingBufferStream.append val
|
||||||
|
|
||||||
template checkOutputsMatch =
|
template checkOutputsMatch =
|
||||||
# fileStream.flush
|
fileStream.flush
|
||||||
|
|
||||||
let
|
let
|
||||||
# fileContents = readFile(tempFilePath).string.bytes
|
fileContents = readFile(tempFilePath).string.bytes
|
||||||
memStreamContents = memStream.getOutput
|
memStreamContents = memStream.getOutput
|
||||||
|
|
||||||
let outputsMatch =
|
let outputsMatch =
|
||||||
|
|
@ -77,7 +77,7 @@ suite "output stream":
|
||||||
let cursorStart = memStream.pos
|
let cursorStart = memStream.pos
|
||||||
altOutput.add delayedWriteContent
|
altOutput.add delayedWriteContent
|
||||||
|
|
||||||
# fileStream.append delayedWriteContent
|
fileStream.append delayedWriteContent
|
||||||
existingBufferStream.append delayedWriteContent
|
existingBufferStream.append delayedWriteContent
|
||||||
|
|
||||||
var totalBytesWritten = 0
|
var totalBytesWritten = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue