Skip to content

Commit

Permalink
Const tuple unpacking: add tests (nim-lang#10100)
Browse files Browse the repository at this point in the history
  • Loading branch information
ee7 authored and Araq committed Dec 27, 2018
1 parent 1b7c848 commit cc4720f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/tuples/ttuples_various.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit cc4720f

Please sign in to comment.