summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-07-19 18:43:31 +0800
committerGitHub <noreply@github.com>2021-07-19 12:43:31 +0200
commitbdfee32dc8e81dd6c727d711a7b1c1fad1728383 (patch)
tree833091d11a7d243cc848b5373477ec2d8d586cf4 /tests
parent488e9c2991cd6f4ae946dd719271ea284a051891 (diff)
downloadNim-bdfee32dc8e81dd6c727d711a7b1c1fad1728383.tar.gz
close #18489 (#18524)
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tstrtabs2.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/stdlib/tstrtabs2.nim b/tests/stdlib/tstrtabs2.nim
new file mode 100644
index 000000000..cb534f198
--- /dev/null
+++ b/tests/stdlib/tstrtabs2.nim
@@ -0,0 +1,15 @@
+discard """
+  targets: "c cpp js"
+"""
+
+import std/strtabs
+
+macro m =
+  var t = {"name": "John"}.newStringTable
+  doAssert t["name"] == "John"
+
+block:
+  var t = {"name": "John"}.newStringTable
+  doAssert t["name"] == "John"
+
+m()