diff options
author | Dmitry Atamanov <data-man@users.noreply.github.com> | 2018-07-07 22:03:22 +0300 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-07 21:03:22 +0200 |
commit | a6c3bbf01a144ee2d6d3ca5f8032c52877560972 (patch) | |
tree | ba29770b190a571abb5387b1da17aca34d716812 /tests | |
parent | 88714e77d82e65b68da79bbff1b491e56f874a08 (diff) | |
download | Nim-a6c3bbf01a144ee2d6d3ca5f8032c52877560972.tar.gz |
Add proc toOpenArray[byte] for strings (#7820)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/tsystem_misc.nim | 16 |
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)) |