diff options
author | Araq <rumpf_a@web.de> | 2011-10-28 17:57:58 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-10-28 17:57:58 +0200 |
commit | 22115a2c6a43709aba02054b77ce2e641f280be1 (patch) | |
tree | be232f47fb7beacb4761e9ebb882265734268401 /tests/accept | |
parent | a0a8934a4f089f8a438da280a4c80051ba3607b5 (diff) | |
download | Nim-22115a2c6a43709aba02054b77ce2e641f280be1.tar.gz |
splicing tested and documented
Diffstat (limited to 'tests/accept')
-rwxr-xr-x | tests/accept/run/tslices.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/accept/run/tslices.nim b/tests/accept/run/tslices.nim index 1061b4245..0de1171e3 100755 --- a/tests/accept/run/tslices.nim +++ b/tests/accept/run/tslices.nim @@ -4,6 +4,8 @@ discard """ 456456 456456 Zugr5nd +egerichtetd +verichtetd ''' """ @@ -41,3 +43,17 @@ echo() echo mystr +mystr[4..4] = "u" + +# test full replacement +mystr[.. -2] = "egerichtet" + +echo mystr + +mystr[0..2] = "ve" +echo mystr + +var s = "abcdef" +s[1 .. -2] = "xyz" +assert s == "axyzf" + |