diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-06-14 07:54:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-06-14 07:54:51 (GMT) |
commit | b7a1ba3ba40ba71b65cefedc057bbccf0323f4a5 (patch) | |
tree | fd3f725641f7ff06608e6e77394d4bcefb5ef3ec /tests | |
parent | f019737860823b97cfde68d64a5175fa21c3a967 (diff) | |
parent | 78e17f7f0cce0233cc1009b3f7c3aa2ea32763d7 (diff) | |
download | tcl-b7a1ba3ba40ba71b65cefedc057bbccf0323f4a5.zip tcl-b7a1ba3ba40ba71b65cefedc057bbccf0323f4a5.tar.gz tcl-b7a1ba3ba40ba71b65cefedc057bbccf0323f4a5.tar.bz2 |
Rebase to core-8-6-branch (who told that fossil doesn't know how to rebase ....)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cmdIL.test | 4 | ||||
-rw-r--r-- | tests/format.test | 19 | ||||
-rw-r--r-- | tests/link.test | 21 | ||||
-rw-r--r-- | tests/util.test | 24 |
4 files changed, 63 insertions, 5 deletions
diff --git a/tests/cmdIL.test b/tests/cmdIL.test index 23a5f96..70ac6bb 100644 --- a/tests/cmdIL.test +++ b/tests/cmdIL.test @@ -219,8 +219,8 @@ test cmdIL-3.10 {SortCompare procedure, -integer option} -body { lsort -integer {3 q} } -returnCodes error -result {expected integer but got "q"} test cmdIL-3.11 {SortCompare procedure, -integer option} { - lsort -integer {35 21 0x20 30 0o23 100 8} -} {8 0o23 21 30 0x20 35 100} + lsort -integer {35 21 0x20 0d30 0o23 100 8} +} {8 0o23 21 0d30 0x20 35 100} test cmdIL-3.12 {SortCompare procedure, -real option} -body { lsort -real {6...4 3} } -returnCodes error -result {expected floating-point number but got "6...4"} diff --git a/tests/format.test b/tests/format.test index 9afedd9..8842315 100644 --- a/tests/format.test +++ b/tests/format.test @@ -78,6 +78,25 @@ test format-1.11.1 {integer formatting} longIs64bit { test format-1.12 {integer formatting} { format "%b %#b %#b %llb" 5 0 5 [expr {2**100}] } {101 0b0 0b101 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} +test format-1.13 {integer formatting} longIs32bit { + format "%#d %#d %#d %#d %#d" 0 6 34 16923 -12 -1 +} {0d0 0d6 0d34 0d16923 -0d12} +test format-1.13.1 {integer formatting} longIs64bit { + format "%#d %#d %#d %#d %#d" 0 6 34 16923 -12 -1 +} {0d0 0d6 0d34 0d16923 -0d12} +test format-1.14 {integer formatting} longIs32bit { + format "%#5d %#20d %#20d %#20d %#20d" 0 6 34 16923 -12 -1 +} { 0d0 0d6 0d34 0d16923 -0d12} +test format-1.14.1 {integer formatting} longIs64bit { + format "%#5d %#20d %#20d %#20d %#20d" 0 6 34 16923 -12 -1 +} { 0d0 0d6 0d34 0d16923 -0d12} +test format-1.15 {integer formatting} longIs32bit { + format "%-#5d %-#20d %-#20d %-#20d %-#20d" 0 6 34 16923 -12 -1 +} {0d0 0d6 0d34 0d16923 -0d12 } +test format-1.15.1 {integer formatting} longIs64bit { + format "%-#5d %-#20d %-#20d %-#20d %-#20d" 0 6 34 16923 -12 -1 +} {0d0 0d6 0d34 0d16923 -0d12 } + test format-2.1 {string formatting} { format "%s %s %c %s" abcd {This is a very long test string.} 120 x diff --git a/tests/link.test b/tests/link.test index 6bff356..a12759d 100644 --- a/tests/link.test +++ b/tests/link.test @@ -173,6 +173,27 @@ test link-2.9 {writing C variables from Tcl} -constraints {testlink} -setup { set uwide 0 concat [testlink get] | $int $real $bool $string $wide $char $uchar $short $ushort $uint $long $ulong $float $uwide } -result {0 5000.0 0 0 0 0 0 0 0 0 0 0 -60.0 0 | 0 5000e 0 0 0 0 0 0 0 0 0 0 -60.00e+ 0} +test link-2.10 {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 "0D" + set char "0X" + set uchar "0B" + set short "0D" + set ushort "0x" + set uint "0b" + set long "0d" + set ulong "0X" + set float "0B" + set uwide "0D" + 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 0D 0X 0B 0D 0x 0b 0d 0X 0B 0D} test link-3.1 {read-only variables} -constraints {testlink} -setup { testlink delete diff --git a/tests/util.test b/tests/util.test index 7782f35..46bb945 100644 --- a/tests/util.test +++ b/tests/util.test @@ -208,7 +208,7 @@ test util-4.6 {Tcl_ConcatObj - utf-8 sequence with "whitespace" char} { } \xe0 test util-4.7 {Tcl_ConcatObj - refCount safety} testconcatobj { # Check for Bug #1447328 (actually, bugs in its original "fix"). One of the - # symptoms was Bug #2055782. + # symptoms was Bug #2055782. testconcatobj } {} @@ -552,6 +552,12 @@ test util-9.0.6 {TclGetIntForIndex} { test util-9.0.7 {TclGetIntForIndex} { string index abcd { 01 } } b +test util-9.0.8 {TclGetIntForIndex} { + string index abcd { 0d0 } +} a +test util-9.0.9 {TclGetIntForIndex} { + string index abcd { -0d0 } +} a test util-9.1.0 {TclGetIntForIndex} { string index abcd 3 } d @@ -564,9 +570,15 @@ test util-9.1.2 {TclGetIntForIndex} { test util-9.1.3 {TclGetIntForIndex} { string index abcdefghijk { 0xa } } k +test util-9.1.4 {TclGetIntForIndex} { + string index abcdefghijk 0d10 +} k +test util-9.1.5 {TclGetIntForIndex} { + string index abcdefghijk { 0d10 } +} k test util-9.2.0 {TclGetIntForIndex} { string index abcd end -} d +} d test util-9.2.1 {TclGetIntForIndex} -body { string index abcd { end} } -returnCodes error -match glob -result * @@ -671,12 +683,18 @@ test util-9.30 {TclGetIntForIndex} -body { test util-9.31 {TclGetIntForIndex} -body { string index a 0x } -returnCodes error -match glob -result * +test util-9.31.1 {TclGetIntForIndex} -body { + string index a 0d +} -returnCodes error -match glob -result * test util-9.32 {TclGetIntForIndex} -body { string index a 0x1FFFFFFFF+0 } -returnCodes error -match glob -result * test util-9.33 {TclGetIntForIndex} -body { string index a 100000000000+0 } -returnCodes error -match glob -result * +test util-9.33.1 {TclGetIntForIndex} -body { + string index a 0d100000000000+0 +} -returnCodes error -match glob -result * test util-9.34 {TclGetIntForIndex} -body { string index a 1.0 } -returnCodes error -match glob -result * @@ -4007,7 +4025,7 @@ test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} { } set r } [list {*}{ - 0x43fffffffffffffc 0xc3fffffffffffffc + 0x43fffffffffffffc 0xc3fffffffffffffc 0x43fffffffffffffc 0xc3fffffffffffffc 0x43fffffffffffffd 0xc3fffffffffffffd 0x43fffffffffffffe 0xc3fffffffffffffe |