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:
Clyybber
2019-09-29 22:20:00 +02:00
committed by Andreas Rumpf
parent 85db42ad8c
commit 16c39f9b2e
2 changed files with 114 additions and 28 deletions

View File

@@ -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