summary refs log tree commit diff stats
path: root/tests/stdlib/tstreams3.nim
blob: 89f45f275dbc91b88fcd43ba909270530fb75587 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  output: "threw exception"
  nimout: '''
I
AM
GROOT
'''
"""
import streams

try:
  var fs = openFileStream("shouldneverexist.txt")
except IoError:
  echo "threw exception"

static:
  var s = newStringStream("I\nAM\nGROOT")
  for line in s.lines:
    echo line
  s.close