Const tuple unpacking: add tests (#10100)

This commit is contained in:
ee7
2018-12-27 22:40:40 +01:00
committed by Andreas Rumpf
parent 1b7c8482fe
commit cc4720fac1

View File

@@ -66,6 +66,22 @@ block unpack_asgn:
block unpack_const:
const (a, ) = (1, )
doAssert a == 1
const (b, c) = (2, 3)
doAssert b == 2
doAssert c == 3
# bug #10098
const (x, y, z) = (4, 5, 6)
doAssert x == 4
doAssert y == 5
doAssert z == 6
block tuple_subscript:
proc`[]` (t: tuple, key: string): string =
for name, field in fieldPairs(t):