diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-09-27 13:46:04 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-09-27 13:46:04 +0100 |
commit | 0370dff8e07698228f56c02b05687321e04be402 (patch) | |
tree | 896f56a062f37652068c830a6cd5104df611fc09 /tests/stdlib | |
parent | 9c5f89ac856b7094e7c43fb78ab1a1c9301a58ee (diff) | |
parent | 772c25bfe8424bb187690ee0959375cd5027d897 (diff) | |
download | Nim-0370dff8e07698228f56c02b05687321e04be402.tar.gz |
Merge pull request #3378 from jlp765/streamsEx
Streams examples & default newFileStream() file mode
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tstreams2.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/stdlib/tstreams2.nim b/tests/stdlib/tstreams2.nim new file mode 100644 index 000000000..90102d8e3 --- /dev/null +++ b/tests/stdlib/tstreams2.nim @@ -0,0 +1,13 @@ +discard """ + 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() |