Merge pull request #2326 from oderwat/fix-totable

Making tuples anonymous (so far... not finished).
This commit is contained in:
Andreas Rumpf
2015-03-17 10:29:32 +01:00
2 changed files with 29 additions and 25 deletions

View File

@@ -2,7 +2,7 @@ discard """
output: '''true'''
"""
import hashes, tables
import hashes, tables, sequtils
const
data = {
@@ -103,9 +103,10 @@ block countTableTest1:
block SyntaxTest:
var x = newTable[int, string]({:})
discard x
block nilTest:
var i, j: PTable[int, int] = nil
var i, j: TableRef[int, int] = nil
assert i == j
j = newTable[int, int]()
assert i != j
@@ -131,6 +132,10 @@ proc orderedTableSortTest() =
# check that insert still works:
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()
echo "true"