summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-10-23 03:26:50 +0200
committerGitHub <noreply@github.com>2020-10-23 03:26:50 +0200
commit01a62320f03ebd3282a7def231351c4f84c319d2 (patch)
tree13f2747e3c8101f44d20f82255b51a7a36b38511 /tests/stdlib
parent2cb484cefb13e4663afd8e0eb2ad81d43f097803 (diff)
downloadNim-01a62320f03ebd3282a7def231351c4f84c319d2.tar.gz
Fix #12410 (#15685)
* Fix #12410, big thanks to @pmetras for this fix

* Add testcase
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/tstreams.nim13
1 files changed, 13 insertions, 0 deletions
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
+