Fix guard for streams tests
This commit is contained in:
parent
55e126c5c8
commit
d3fc943b6d
1 changed files with 1 additions and 1 deletions
|
|
@ -449,7 +449,7 @@ else:
|
||||||
if handle < 0: raise newEOS("posix.open() call failed")
|
if handle < 0: raise newEOS("posix.open() call failed")
|
||||||
result = newFileHandleStream(handle)
|
result = newFileHandleStream(handle)
|
||||||
|
|
||||||
when defined(testing):
|
when isMainModule and defined(testing):
|
||||||
var ss = newStringStream("The quick brown fox jumped over the lazy dog.\nThe lazy dog ran")
|
var ss = newStringStream("The quick brown fox jumped over the lazy dog.\nThe lazy dog ran")
|
||||||
assert(ss.getPosition == 0)
|
assert(ss.getPosition == 0)
|
||||||
assert(ss.peekStr(5) == "The q")
|
assert(ss.peekStr(5) == "The q")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue