* fix js unsigned integer * better * close #13859; add testcase
This commit is contained in:
parent
ccc0667c29
commit
c1a06bd56e
1 changed files with 19 additions and 0 deletions
19
tests/stdlib/tcstring.nim
Normal file
19
tests/stdlib/tcstring.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
targets: "c cpp js"
|
||||
"""
|
||||
|
||||
|
||||
block: # bug #13859
|
||||
let str = "abc".cstring
|
||||
doAssert len(str).int8 == 3
|
||||
doAssert len(str).int16 == 3
|
||||
doAssert len(str).int32 == 3
|
||||
var str2 = "cde".cstring
|
||||
doAssert len(str2).int8 == 3
|
||||
doAssert len(str2).int16 == 3
|
||||
doAssert len(str2).int32 == 3
|
||||
|
||||
const str3 = "abc".cstring
|
||||
doAssert len(str3).int32 == 3
|
||||
doAssert len("abc".cstring).int16 == 3
|
||||
doAssert len("abc".cstring).float32 == 3.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue