summary refs log tree commit diff stats
path: root/tests/cpp/tcasts.nim
blob: 80527efff4cb827e49806a9fe84f6a8b1a16a747 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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