diff options
author | Daniil Yarancev <21169548+Yardanico@users.noreply.github.com> | 2018-06-05 21:25:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 21:25:45 +0300 |
commit | 642641359821b6a63c6cf7edaaa45873b7ea59c7 (patch) | |
tree | 627af3020528cb916b3174bd94304307ca875c77 /tests/system/tsystem_misc.nim | |
parent | fb44c522e6173528efa8035ecc459c84887d0167 (diff) | |
parent | 3cbc07ac7877b03c605498760fe198e3200cc197 (diff) | |
download | Nim-642641359821b6a63c6cf7edaaa45873b7ea59c7.tar.gz |
Merge pull request #2 from nim-lang/devel
Update
Diffstat (limited to 'tests/system/tsystem_misc.nim')
-rw-r--r-- | tests/system/tsystem_misc.nim | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim index ce36895a1..85228e9e7 100644 --- a/tests/system/tsystem_misc.nim +++ b/tests/system/tsystem_misc.nim @@ -1,5 +1,17 @@ discard """ - output:"" + output:'''1 +1 +2 +3 +11 +12 +13 +14 +15 +2 +3 +4 +''' """ # check high/low implementations @@ -20,3 +32,18 @@ doAssert high(float64) > low(float64) # bug #6710 var s = @[1] s.delete(0) + + +proc foo(a: openArray[int]) = + for x in a: echo x + +foo(toOpenArray([1, 2, 3], 0, 0)) + +foo(toOpenArray([1, 2, 3], 0, 2)) + +var arr: array[8..12, int] = [11, 12, 13, 14, 15] + +foo(toOpenArray(arr, 8, 12)) + +var seqq = @[1, 2, 3, 4, 5] +foo(toOpenArray(seqq, 1, 3)) |