Support Nim 1.2
This commit is contained in:
parent
5fb40e4ffd
commit
8a3cf6778d
3 changed files with 13 additions and 11 deletions
|
|
@ -10,11 +10,7 @@ skipDirs = @["tests"]
|
||||||
requires "nim >= 0.17.0",
|
requires "nim >= 0.17.0",
|
||||||
"stew"
|
"stew"
|
||||||
|
|
||||||
task test, "Run tests":
|
task test, "Run all tests":
|
||||||
for filename in [
|
exec "nim c -r --threads:off tests/all_tests"
|
||||||
"test_input_stream",
|
exec "nim c -r --threads:on tests/all_tests"
|
||||||
"test_output_stream"
|
|
||||||
]:
|
|
||||||
exec "nim c -r tests/" & filename
|
|
||||||
rmFile "tests/" & filename
|
|
||||||
|
|
||||||
|
|
|
||||||
4
tests/all_tests.nim
Normal file
4
tests/all_tests.nim
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
import
|
||||||
|
test_input_stream,
|
||||||
|
test_output_stream
|
||||||
|
|
||||||
|
|
@ -47,10 +47,12 @@ suite "output stream":
|
||||||
# fileContents = readFile(tempFilePath).string.bytes
|
# fileContents = readFile(tempFilePath).string.bytes
|
||||||
memStreamContents = memStream.getOutput
|
memStreamContents = memStream.getOutput
|
||||||
|
|
||||||
check altOutput == memStreamContents
|
let outputsMatch =
|
||||||
# check altOutput == fileContents
|
altOutput == memStreamContents and
|
||||||
check altOutput == makeOpenArray(cast[ptr byte](buffer),
|
altOutput == makeOpenArray(cast[ptr byte](buffer),
|
||||||
existingBufferStream.pos)
|
existingBufferStream.pos)
|
||||||
|
|
||||||
|
check outputsMatch
|
||||||
|
|
||||||
test "no appends produce an empty output":
|
test "no appends produce an empty output":
|
||||||
checkOutputsMatch()
|
checkOutputsMatch()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue