jsonutils: support set (#17994)

This commit is contained in:
Timothee Cour 2021-05-11 12:09:17 -07:00 • committed by GitHub
commit a770c98e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View file

@ -70,6 +70,12 @@ template fn() =
doAssert b2.ord == 1 # explains the `1`
testRoundtrip(a): """[1,2,3]"""
block: # set
type Foo = enum f1, f2, f3, f4, f5
# type Goo = enum g1 = 10, g2 = 15, g3 = 17, g4 # in future PR, elements for holey enum should be treated as enum, not string
let a = ({f1, f3}, {1'u8, 7'u8}, {'0'..'9'}, {123'u16, 456, 789, 1121, 1122, 1542})
testRoundtrip(a): """[[0,2],[1,7],[48,49,50,51,52,53,54,55,56,57],[123,456,789,1121,1122,1542]]"""
block: # bug #17383
block:
let a = (int32.high, uint32.high)