summaryrefslogtreecommitdiffstats
path: root/tests/link.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-22 10:26:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-22 10:26:08 (GMT)
commit2951ee2fea9f8e7ca7911bbe2d29d802c5b9f6ba (patch)
treea90915bee23d0722dd192fe05c4cf8d682b8a48c /tests/link.test
parent70346ccd7b408b992402ed59d6264eefcd83f8d6 (diff)
parentcbfc7befb07093bef98624752aef4c5c1797896a (diff)
downloadtcl-2951ee2fea9f8e7ca7911bbe2d29d802c5b9f6ba.zip
tcl-2951ee2fea9f8e7ca7911bbe2d29d802c5b9f6ba.tar.gz
tcl-2951ee2fea9f8e7ca7911bbe2d29d802c5b9f6ba.tar.bz2
Merge trunk. Implement sequences like "0x", "0b" and "0o" as well. And also the "." for doubles and floats.
Diffstat (limited to 'tests/link.test')
-rw-r--r--tests/link.test84
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/link.test b/tests/link.test
index 0ea7cf6..71f3767 100644
--- a/tests/link.test
+++ b/tests/link.test
@@ -89,6 +89,90 @@ test link-2.5 {writing bad values into variables} -setup {
testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
list [catch {set wide gorp} msg] $msg $bool
} -result {1 {can't set "wide": variable must have integer or boolean value} 1}
+test link-2.6 {writing C variables from Tcl} -constraints {testlink} -setup {
+ testlink delete
+} -body {
+ testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234
+ testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ set int "+"
+ set real "+"
+ set bool "+"
+ set string "+"
+ set wide "+"
+ set char "+"
+ set uchar "+"
+ set short "+"
+ set ushort "+"
+ set uint "+"
+ set long "+"
+ set ulong "+"
+ set float "+"
+ set uwide "+"
+ concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide
+} -result {1 1.0 1 + 1 1 1 1 1 1 1 1 1.0 1 | + + + + + + + + + + + + + +}
+test link-2.7 {writing C variables from Tcl} -constraints {testlink} -setup {
+ testlink delete
+} -body {
+ testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234
+ testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ set int "-"
+ set real "-"
+ set bool "-"
+ set string "-"
+ set wide "-"
+ set char "-"
+ set uchar "-"
+ set short "-"
+ set ushort "-"
+ set uint "-"
+ set long "-"
+ set ulong "-"
+ set float "-"
+ set uwide "-"
+ concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide
+} -result {0 0.0 0 - 0 0 0 0 0 0 0 0 0.0 0 | - - - - - - - - - - - - - -}
+test link-2.7 {writing C variables from Tcl} -constraints {testlink} -setup {
+ testlink delete
+} -body {
+ testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234
+ testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ set int "o"
+ set real "."
+ set bool "o"
+ set string "o"
+ set wide "o"
+ set char "o"
+ set uchar "o"
+ set short "o"
+ set ushort "o"
+ set uint "o"
+ set long "o"
+ set ulong "o"
+ set float "."
+ set uwide "o"
+ concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide
+} -result {0 0.0 0 o 0 0 0 0 0 0 0 0 0.0 0 | o . o o o o o o o o o o . o}
+test link-2.8 {writing C variables from Tcl} -constraints {testlink} -setup {
+ testlink delete
+} -body {
+ testlink set 43 1.21 4 - 56785678 64 250 30000 60000 0xbaadbeef 12321 32123 3.25 1231231234
+ testlink create 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ set int "0x"
+ set real "0b"
+ set bool "0"
+ set string "0"
+ set wide "0O"
+ set char "0X"
+ set uchar "0B"
+ set short "0O"
+ set ushort "0x"
+ set uint "0b"
+ set long "0o"
+ set ulong "0X"
+ set float "0B"
+ set uwide "0O"
+ concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide
+} -result {0 0.0 0 0 0 0 0 0 0 0 0 0 0.0 0 | 0x 0b 0 0 0O 0X 0B 0O 0x 0b 0o 0X 0B 0O}
test link-3.1 {read-only variables} -constraints {testlink} -setup {
testlink delete