Support Nim 1.2

This commit is contained in:
Zahary Karadjov 2020-03-24 16:29:57 +02:00
commit 8a3cf6778d
No known key found for this signature in database
GPG key ID: C8936F8A3073D609
3 changed files with 13 additions and 11 deletions

View file

@ -10,11 +10,7 @@ skipDirs = @["tests"]
requires "nim >= 0.17.0",
"stew"
task test, "Run tests":
for filename in [
"test_input_stream",
"test_output_stream"
]:
exec "nim c -r tests/" & filename
rmFile "tests/" & filename
task test, "Run all tests":
exec "nim c -r --threads:off tests/all_tests"
exec "nim c -r --threads:on tests/all_tests"

4
tests/all_tests.nim Normal file
View file

@ -0,0 +1,4 @@
import
test_input_stream,
test_output_stream

View file

@ -47,10 +47,12 @@ suite "output stream":
# fileContents = readFile(tempFilePath).string.bytes
memStreamContents = memStream.getOutput
check altOutput == memStreamContents
# check altOutput == fileContents
check altOutput == makeOpenArray(cast[ptr byte](buffer),
existingBufferStream.pos)
let outputsMatch =
altOutput == memStreamContents and
altOutput == makeOpenArray(cast[ptr byte](buffer),
existingBufferStream.pos)
check outputsMatch
test "no appends produce an empty output":
checkOutputsMatch()