summaryrefslogtreecommitdiffstats
path: root/tests/scan.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-14 09:05:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-04-14 09:05:01 (GMT)
commit73eb386816168576a6c42eea64be0b214e6d7d6c (patch)
tree632320ff8144756f72cf3850bede8c0170fc5c5c /tests/scan.test
parentbc97ae8a02bb8363f85b25501b9aa125c5b344cd (diff)
downloadtcl-73eb386816168576a6c42eea64be0b214e6d7d6c.zip
tcl-73eb386816168576a6c42eea64be0b214e6d7d6c.tar.gz
tcl-73eb386816168576a6c42eea64be0b214e6d7d6c.tar.bz2
Don't use "0%o" format in test-cases, as it suggest's it's the normal way to format octal numbers: it isn't. Better use "%#o".
Add tests for "format" and "scan" corner-cases which weren't documented (except in TIP's) neither had tests before.
Diffstat (limited to 'tests/scan.test')
-rw-r--r--tests/scan.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/scan.test b/tests/scan.test
index 7540c9c..b36b412 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -541,6 +541,24 @@ 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 {}
+} -body {
+ list [scan "207698809136909011942886895,abcdef0123456789abcdef,125715736004432126361152746757" \
+ %lld,%llx,%llo a b c] $a $b $c
+} -result {3 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-5.18 {bigint scanning invalid} -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 {}