diff options
author | fowlmouth <phowl.mouth@gmail.com> | 2015-06-01 11:01:50 -0500 |
---|---|---|
committer | fowlmouth <phowl.mouth@gmail.com> | 2015-06-01 11:01:50 -0500 |
commit | 80a13a408e39ca197f42398163ef7917a64d1aad (patch) | |
tree | baefe58e975bdff223082b57570e035b41a70b07 | |
parent | 87c8d586b5955e8183b822016a3ebd2fcd0a821c (diff) | |
download | Nim-80a13a408e39ca197f42398163ef7917a64d1aad.tar.gz |
added a test
-rw-r--r-- | tests/typerel/tstr_as_openarray.nim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/typerel/tstr_as_openarray.nim b/tests/typerel/tstr_as_openarray.nim new file mode 100644 index 000000000..fc28d6c93 --- /dev/null +++ b/tests/typerel/tstr_as_openarray.nim @@ -0,0 +1,22 @@ +discard """ + output: '''success''' +""" +var s = "HI" + +proc x (zz: openarray[char]) = + discard + +x s + +proc z [T] (zz: openarray[T]) = + discard + +z s +z([s,s,s]) + +proc y [T] (arg: var openarray[T]) = + arg[0] = 'X' +y s +doAssert s == "XI" + +echo "success" |