Test for non-string keys of table

This commit is contained in:
Alexander Ivanov 2020-05-08 13:06:40 +03:00 committed by zah
parent 9f085c33a9
commit f310607d04
1 changed files with 2 additions and 0 deletions

View File

@ -276,6 +276,7 @@ proc executeRoundtripTests*(Format: type) =
t1 = {"test": 0, "other": 1}.toTable() t1 = {"test": 0, "other": 1}.toTable()
t2 = {"test": 0, "other": 1}.toOrderedTable() t2 = {"test": 0, "other": 1}.toOrderedTable()
t3 = newTable[string, int]() t3 = newTable[string, int]()
t4 = {0: "test", 1: "other"}.toTable()
t3["test"] = 0 t3["test"] = 0
t3["other"] = 1 t3["other"] = 1
@ -283,6 +284,7 @@ proc executeRoundtripTests*(Format: type) =
roundtrip t1 roundtrip t1
roundtrip t2 roundtrip t2
roundtrip t3 roundtrip t3
roundtrip t4
test "sets": test "sets":
var s1 = toHashSet([1, 2, 3, 1, 4, 2]) var s1 = toHashSet([1, 2, 3, 1, 4, 2])