fixes #14079 [backport:1.2] (#14163)

This commit is contained in:
Andreas Rumpf 2020-04-29 21:58:59 +02:00 • committed by GitHub
commit d9e907c0e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 7 deletions

View file

@ -46,7 +46,7 @@ type
proc `=destroy`(x: var AObj) =
close(x.io)
echo "closed"
var x = B(io: newStringStream("thestream"))
@ -64,4 +64,14 @@ proc main() =
cryptCTR(nonce2.toOpenArray(0, nonce2.len-1))
doAssert(nonce2 == "0A234567")
main()
main()
# bug #14079
import std/algorithm
let
n = @["c", "b"]
q = @[("c", "2"), ("b", "1")]
assert n.sortedByIt(it) == @["b", "c"], "fine"
assert q.sortedByIt(it[0]) == @[("b", "1"), ("c", "2")], "fails under arc"