newruntime: added a basic table test

This commit is contained in:
Andreas Rumpf
2019-06-11 08:58:11 +02:00
parent ced0527ae3
commit 51ac2e67bf

View File

@@ -0,0 +1,24 @@
discard """
cmd: '''nim c --newruntime $file'''
output: '''(field: "value")
3 3 new: 0'''
"""
import core / allocators
import system / ansi_c
import tables
type
Node = ref object
field: string
proc main =
var w = newTable[string, owned Node]()
w["key"] = Node(field: "value")
echo w["key"][]
main()
let (a, d) = allocCounters()
discard cprintf("%ld %ld new: %ld\n", a, d, allocs)