diff options
-rw-r--r-- | tests/stdlib/tstreams2.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/stdlib/tstreams2.nim b/tests/stdlib/tstreams2.nim new file mode 100644 index 000000000..b3e957261 --- /dev/null +++ b/tests/stdlib/tstreams2.nim @@ -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() |