summary refs log tree commit diff stats
path: root/tests/cpp/tcasts.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp/tcasts.nim')
-rw-r--r--tests/cpp/tcasts.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/cpp/tcasts.nim b/tests/cpp/tcasts.nim
new file mode 100644
index 000000000..80527efff
--- /dev/null
+++ b/tests/cpp/tcasts.nim
@@ -0,0 +1,20 @@
+discard """
+  cmd: "nim cpp $file"
+  targets: "cpp"
+"""
+
+block: #5979
+  var a = 'a'
+  var p: pointer = cast[pointer](a)
+  var c = cast[char](p)
+  doAssert(c == 'a')
+
+
+#----------------------------------------------------
+# bug #9739
+import tables
+
+var t = initTable[string, string]()
+discard t.hasKeyOrPut("123", "123")
+discard t.mgetOrPut("vas", "kas")
+doAssert t.len == 2