diff options
author | JamesP <jlp765@gmail.com> | 2015-09-26 08:34:59 +1000 |
---|---|---|
committer | JamesP <jlp765@gmail.com> | 2015-09-26 08:34:59 +1000 |
commit | e0707797a52f68423b2cc9c287d6356366d41c56 (patch) | |
tree | 4606b96d1a9e83add4c750807dcbf360bc28655b /tests/stdlib/tstreams2.nim | |
parent | ff9a3d39d76602c929fcadb453a2ae2ca79559bc (diff) | |
download | Nim-e0707797a52f68423b2cc9c287d6356366d41c56.tar.gz |
add test for newFileStream() opening a missing file
Diffstat (limited to 'tests/stdlib/tstreams2.nim')
-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() |