More comprehensive OutputStream; Basic support for stream cursors

This commit is contained in:
Zahary Karadjov 2019-03-11 11:36:32 +02:00
commit 7903f1680f
5 changed files with 164 additions and 49 deletions

View 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))

View file

@ -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: