Initial version (extracted from nim-serialization)

This commit is contained in:
Zahary Karadjov 2018-12-17 23:48:33 +02:00
commit cb54254b77
7 changed files with 501 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import
unittest,
../faststreams
suite "output stream":
test "string output":
var s = init StringOutputStream
var altOutput = ""
for i in 0 .. 1000:
s.appendNumber i
s.append " bottles on the wall"
s.append byte('\n')
altOutput.add $i
altOutput.add " bottles on the wall"
altOutput.add '\n'
let streamOutput = s.getOutput
check streamOutput == altOutput