More of StringStream now works at compile time (#12284)
* readLine of StringStream now works at compile time * Work for js backend only at compile time * readAll now works at CT * readAll works in js ct now * Add test
This commit is contained in:
parent
85db42ad8c
commit
16c39f9b2e
2 changed files with 114 additions and 28 deletions
|
|
@ -1,5 +1,10 @@
|
|||
discard """
|
||||
output: "threw exception"
|
||||
nimout: '''
|
||||
I
|
||||
AM
|
||||
GROOT
|
||||
'''
|
||||
"""
|
||||
import streams
|
||||
|
||||
|
|
@ -7,3 +12,9 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue