Initial version (extracted from nim-serialization)
This commit is contained in:
commit
cb54254b77
7 changed files with 501 additions and 0 deletions
21
tests/test_output_stream.nim
Normal file
21
tests/test_output_stream.nim
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue