Added Test for zip() with anonymous tuples.

This commit is contained in:
Hans Raaf 2015-03-17 00:14:40 +01:00
commit a41778725a

View file

@ -2,7 +2,7 @@ discard """
output: '''true''' output: '''true'''
""" """
import hashes, tables import hashes, tables, sequtils
const const
data = { data = {
@ -103,9 +103,10 @@ block countTableTest1:
block SyntaxTest: block SyntaxTest:
var x = newTable[int, string]({:}) var x = newTable[int, string]({:})
discard x
block nilTest: block nilTest:
var i, j: PTable[int, int] = nil var i, j: TableRef[int, int] = nil
assert i == j assert i == j
j = newTable[int, int]() j = newTable[int, int]()
assert i != j assert i != j
@ -131,6 +132,10 @@ proc orderedTableSortTest() =
# check that insert still works: # check that insert still works:
t["newKeyHere"] = 80 t["newKeyHere"] = 80
block anonZipTest:
let keys = @['a','b','c']
let values = @[1, 2, 3]
doAssert "{a: 1, b: 2, c: 3}" == $ toTable zip(keys, values)
orderedTableSortTest() orderedTableSortTest()
echo "true" echo "true"