From 01a62320f03ebd3282a7def231351c4f84c319d2 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Fri, 23 Oct 2020 03:26:50 +0200 Subject: Fix #12410 (#15685) * Fix #12410, big thanks to @pmetras for this fix * Add testcase --- tests/stdlib/tstreams.nim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/stdlib') diff --git a/tests/stdlib/tstreams.nim b/tests/stdlib/tstreams.nim index 354bdf60f..6979bae38 100644 --- a/tests/stdlib/tstreams.nim +++ b/tests/stdlib/tstreams.nim @@ -6,6 +6,7 @@ Nice name: Arne fs is: nil threw exception +_heh_ ''' nimout: ''' I @@ -49,3 +50,15 @@ block tstreams3: for line in s.lines: echo line s.close + +# bug #12410 + +var a = newStringStream "hehohihahuhyh" +a.readDataStrImpl = nil + +var buffer = "_ooo_" + +doAssert a.readDataStr(buffer, 1..3) == 3 + +echo buffer + -- cgit 1.4.1-2-gfad0