summary refs log tree commit diff stats
path: root/tests/arc/tarcmisc.nim
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2020-04-17 12:23:04 +0100
committerGitHub <noreply@github.com>2020-04-17 13:23:04 +0200
commitf10689d3d40d67b185c918440ceef6a6bcee9999 (patch)
treece63f1ab4c02cc3641db71d5db9659ef51097717 /tests/arc/tarcmisc.nim
parentd3b0132061235f316ac554690eb7e471caf95955 (diff)
downloadNim-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.nim17
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