Add roundtrip tests for tables

This commit is contained in:
Zahary Karadjov 2019-08-02 15:08:35 +03:00
parent 897a6638cf
commit e97e0b0684
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import
unittest, times, typetraits, random, strutils, options, sets,
unittest, times, typetraits, random, strutils, options, sets, tables,
faststreams/input_stream,
../../serialization, ../object_serialization
@ -226,6 +226,19 @@ proc executeRoundtripTests*(Format: type) =
roundtrip l2
roundtrip l3
test "tables":
var
t1 = {"test": 0, "other": 1}.toTable()
t2 = {"test": 0, "other": 1}.toOrderedTable()
t3 = newTable[string, int]()
t3["test"] = 0
t3["other"] = 1
roundtrip t1
roundtrip t2
roundtrip t3
test "sets":
var s1 = toSet([1, 2, 3, 1, 4, 2])
var s2 = HoldsSet(a: 100, s: toSet(["a", "b", "c"]))