summary refs log tree commit diff stats
path: root/tests/stdlib/tsharedtable.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tsharedtable.nim')
-rw-r--r--tests/stdlib/tsharedtable.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/stdlib/tsharedtable.nim b/tests/stdlib/tsharedtable.nim
new file mode 100644
index 000000000..3269e7ee3
--- /dev/null
+++ b/tests/stdlib/tsharedtable.nim
@@ -0,0 +1,14 @@
+discard """
+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