mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user