summaryrefslogtreecommitdiffstats
path: root/tests/scan.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scan.test')
-rw-r--r--tests/scan.test8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/scan.test b/tests/scan.test
index 03a5b46..6d7a9fb 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -508,7 +508,7 @@ test scan-5.10 {integer scanning} -setup {
list [scan "1 2 " "%hd %d %d %d" a b c d] $a $b $c $d
} -result {2 1 2 {} {}}
#
-# The behavior for scaning intergers larger than MAX_INT is not defined by the
+# The behavior for scanning integers larger than MAX_INT is not defined by the
# ANSI spec. Some implementations wrap the input (-16) some return MAX_INT.
#
test scan-5.11 {integer scanning} -constraints {nonPortable} -setup {
@@ -858,6 +858,12 @@ test scan-13.8 {Tcl_ScanObjCmd, inline XPG case lots of arguments} {
set msg [scan "10 20 30" {%100$d %5$d %200$d}]
list [llength $msg] [lindex $msg 99] [lindex $msg 4] [lindex $msg 199]
} {200 10 20 30}
+test scan-13.9 {Tcl_ScanObjCmd, inline XPG case limit error} -body {
+ # Note this applies to 64-bit builds as well so long as max number of
+ # command line arguments allowed for scan command is INT_MAX
+ scan abc {%2147483648$s}
+} -result {"%n$" argument index out of range} -returnCodes error
+
# scan infinities - not working