More comprehensive OutputStream; Basic support for stream cursors
This commit is contained in:
parent
31590a79ec
commit
7903f1680f
5 changed files with 164 additions and 49 deletions
12
tests/test_input_stream.nim
Normal file
12
tests/test_input_stream.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import
|
||||
unittest, strutils, ranges/ptr_arith,
|
||||
../faststreams
|
||||
|
||||
suite "input stream":
|
||||
test "string output":
|
||||
var input = repeat("1234 5678 90AB CDEF\n", 1000)
|
||||
var stream = memoryStream(input)
|
||||
|
||||
check:
|
||||
(stream.readBytes(4) == "1234".toOpenArrayByte(0, 3))
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ import
|
|||
|
||||
suite "output stream":
|
||||
test "string output":
|
||||
var s = init StringOutputStream
|
||||
var s = init OutputStream
|
||||
var altOutput = ""
|
||||
|
||||
for i in 0 .. 1000:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue