summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-05 09:09:20 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-05 09:09:20 (GMT)
commit42f3b8e10cbe3342ebc2ca136374b4c5377dc54c (patch)
treebc483abe6a64177bc46c4a717b7a698fa285ebd2 /tests
parentc4205c013895144b86276219a88a9bb64878295f (diff)
parent224849c744f0f6ceb853162afd318b858835850c (diff)
downloadtcl-42f3b8e10cbe3342ebc2ca136374b4c5377dc54c.zip
tcl-42f3b8e10cbe3342ebc2ca136374b4c5377dc54c.tar.gz
tcl-42f3b8e10cbe3342ebc2ca136374b4c5377dc54c.tar.bz2
Fix [4b12ccb3363e81b132e8dbe12aeec596102be1a8|4b12ccb336]: format/scan %llu doesn't work. Also added new test-cases showing the expected behavior.
Diffstat (limited to 'tests')
-rw-r--r--tests/format.test6
-rw-r--r--tests/scan.test13
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/format.test b/tests/format.test
index 00b6939..a4ea25e 100644
--- a/tests/format.test
+++ b/tests/format.test
@@ -549,6 +549,12 @@ test format-17.3 {testing %ld with non-wide} {wideIs64bit} {
test format-17.4 {testing %l with non-integer} {
format %lf 1
} 1.000000
+test format-17.5 {testing %llu with bignum} {
+ format %llu 0xabcdef0123456789abcdef
+} 207698809136909011942886895
+test format-17.6 {testing %llu with negative number} -body {
+ format %llu -1
+} -returnCodes 1 -result {unsigned bignum format is invalid}
test format-18.1 {do not demote existing numeric values} {
set a 0xaaaaaaaa
diff --git a/tests/scan.test b/tests/scan.test
index 7540c9c..8ddb595 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -541,6 +541,19 @@ test scan-5.15 {Bug be003d570f} {
test scan-5.16 {Bug be003d570f} {
scan 0x40 %b
} 0
+test scan-5.17 {bigint scanning} -setup {
+ set a {}; set b {}; set c {}; set d {}
+} -body {
+ list [scan "207698809136909011942886895,207698809136909011942886895,abcdef0123456789abcdef,125715736004432126361152746757" \
+ %llu,%lld,%llx,%llo a b c d] $a $b $c $d
+} -result {4 207698809136909011942886895 207698809136909011942886895 207698809136909011942886895 207698809136909011942886895}
+test scan-5.18 {bigint scanning underflow} -setup {
+ set a {};
+} -body {
+ list [scan "-207698809136909011942886895" \
+ %llu a] $a
+} -returnCodes 1 -result {unsigned bignum scans are invalid}
+
test scan-6.1 {floating-point scanning} -setup {
set a {}; set b {}; set c {}; set d {}