mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-01 19:44:44 +00:00
streams: implement readStr for VM, document VM limitations (#24058)
fixes #24054 `readData` is not implemented for the VM as mentioned in the issue, but `readDataStr` is, so that is used for `readStr` instead on the VM. We could also just use it in general since it falls back to `readData` anyway but it's kept the same otherwise for now. Also where and why streams in general don't work in VM is now documented on the top level `streams` module documentation.
This commit is contained in:
@@ -92,6 +92,10 @@ static: # Ensure streams it doesnt break with nimscript on arc/orc #19716
|
||||
let s = newStringStream("a")
|
||||
doAssert s.data == "a"
|
||||
|
||||
static: # issue #24054, readStr
|
||||
var s = newStringStream("foo bar baz")
|
||||
doAssert s.readStr(3) == "foo"
|
||||
|
||||
template main =
|
||||
var strm = newStringStream("abcde")
|
||||
var buffer = "12345"
|
||||
|
||||
Reference in New Issue
Block a user