summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorDmitry Atamanov <data-man@users.noreply.github.com>2018-07-07 22:03:22 +0300
committerAndreas Rumpf <rumpf_a@web.de>2018-07-07 21:03:22 +0200
commita6c3bbf01a144ee2d6d3ca5f8032c52877560972 (patch)
treeba29770b190a571abb5387b1da17aca34d716812 /tests
parent88714e77d82e65b68da79bbff1b491e56f874a08 (diff)
downloadNim-a6c3bbf01a144ee2d6d3ca5f8032c52877560972.tar.gz
Add proc toOpenArray[byte] for strings (#7820)
Diffstat (limited to 'tests')
-rw-r--r--tests/system/tsystem_misc.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim
index 6d14aa68f..ce36bc9ef 100644
--- a/tests/system/tsystem_misc.nim
+++ b/tests/system/tsystem_misc.nim
@@ -15,6 +15,16 @@ discard """
 1
 2
 3
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
 '''
 """
 
@@ -86,3 +96,9 @@ doAssertRaises(IndexError):
   foo(toOpenArray(arrNeg, -1, 0))
 doAssertRaises(IndexError):
   foo(toOpenArray(arrNeg, -1, -3))
+
+proc foo(a: openArray[byte]) =
+  for x in a: echo x
+
+let str = "0123456789"
+foo(toOpenArrayByte(str, 0, str.high))