Files
Nim/tests/stdlib/tsharedtable.nim
Ray Imber 9dd297f613 Locks modules should give a compile error when threads are not enabled. (#12231)
* Locks modules should give a compile error when threads are not enabled.

* fix the compile flags to make the tests pass, or ignore files where necessary.

* Fixed when statement to account for doc builds.
2019-09-26 15:45:50 +02:00

16 lines
257 B
Nim

discard """
cmd: "nim $target --threads:on $options $file"
output: '''
'''
"""
import sharedtables
var table: SharedTable[int, int]
init(table)
table[1] = 10
assert table.mget(1) == 10
assert table.mgetOrPut(3, 7) == 7
assert table.mgetOrPut(3, 99) == 7