add test for newFileStream() opening a missing file
This commit is contained in:
parent
ff9a3d39d7
commit
e0707797a5
1 changed files with 14 additions and 0 deletions
14
tests/stdlib/tstreams2.nim
Normal file
14
tests/stdlib/tstreams2.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
discard """
|
||||||
|
test newFileStream opening a missing file returns nil
|
||||||
|
file: "tstreams2.nim"
|
||||||
|
output: 'fs is: nil'
|
||||||
|
"""
|
||||||
|
import streams
|
||||||
|
var
|
||||||
|
fs = newFileStream("amissingfile.txt")
|
||||||
|
line = ""
|
||||||
|
echo "fs is: ",repr(fs)
|
||||||
|
if not isNil(fs):
|
||||||
|
while fs.readLine(line):
|
||||||
|
echo line
|
||||||
|
fs.close()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue