diff options
author | cooldome <cdome@bk.ru> | 2020-04-17 12:23:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 13:23:04 +0200 |
commit | f10689d3d40d67b185c918440ceef6a6bcee9999 (patch) | |
tree | ce63f1ab4c02cc3641db71d5db9659ef51097717 /tests/arc/tarcmisc.nim | |
parent | d3b0132061235f316ac554690eb7e471caf95955 (diff) | |
download | Nim-f10689d3d40d67b185c918440ceef6a6bcee9999.tar.gz |
fixes #14003 (#14006) [backport:1.2]
Co-authored-by: cooldome <ariabushenko@bk.ru>
Diffstat (limited to 'tests/arc/tarcmisc.nim')
-rw-r--r-- | tests/arc/tarcmisc.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim index 687254794..963ae9806 100644 --- a/tests/arc/tarcmisc.nim +++ b/tests/arc/tarcmisc.nim @@ -48,3 +48,20 @@ proc `=destroy`(x: var AObj) = echo "closed" var x = B(io: newStringStream("thestream")) + + +#------------------------------------------------------------------------------ +# issue #14003 + +proc cryptCTR*(nonce: var openArray[char]) = + nonce[1] = 'A' + +proc main() = + var nonce1 = "0123456701234567" + cryptCTR(nonce1) + doAssert(nonce1 == "0A23456701234567") + var nonce2 = "01234567" + cryptCTR(nonce2.toOpenArray(0, nonce2.len-1)) + doAssert(nonce2 == "0A234567") + +main() \ No newline at end of file |