summaryrefslogtreecommitdiffstats
path: root/tests/scan.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scan.test')
-rw-r--r--tests/scan.test28
1 files changed, 16 insertions, 12 deletions
diff --git a/tests/scan.test b/tests/scan.test
index 34351e0..97ad5eb 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -98,10 +98,10 @@ test scan-3.13 {ValidateFormat} {
test scan-4.1 {Tcl_ScanObjCmd, argument checks} {
list [catch {scan} msg] $msg
-} {1 {wrong # args: should be "scan string format ?varName varName ...?"}}
+} {1 {wrong # args: should be "scan string format ?varName ...?"}}
test scan-4.2 {Tcl_ScanObjCmd, argument checks} {
list [catch {scan string} msg] $msg
-} {1 {wrong # args: should be "scan string format ?varName varName ...?"}}
+} {1 {wrong # args: should be "scan string format ?varName ...?"}}
test scan-4.3 {Tcl_ScanObjCmd, argument checks} {
# degenerate case, before changed from 8.2 to 8.3
list [catch {scan string format} msg] $msg
@@ -246,10 +246,14 @@ test scan-4.40.2 {Tcl_ScanObjCmd, base-16 integer scanning} {
catch {unset x}
list [scan {xF} {%x} x] [info exists x]
} {0 0}
+test scan-4.40.3 {Tcl_ScanObjCmd, base-2 integer scanning} {
+ set x {}
+ list [scan {1001 0b101 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} {%b %b %llb} x y z] $x $y $z
+} {3 9 5 340282366920938463463374607431768211456}
test scan-4.41 {Tcl_ScanObjCmd, base-unknown integer scanning} {
set x {}
- list [scan {10 010 0x10} {%i%i%i} x y z] $x $y $z
-} {3 10 8 16}
+ list [scan {10 010 0x10 0b10} {%i%i%i%i} x y z t] $x $y $z $t
+} {4 10 8 16 0}
test scan-4.42 {Tcl_ScanObjCmd, base-unknown integer scanning} {
set x {}
list [scan {10 010 0X10} {%i%i%i} x y z] $x $y $z
@@ -324,7 +328,7 @@ test scan-4.60 {Tcl_ScanObjCmd, set errors} {
$msg $x $y]
unset z
set result
-} {1 {couldn't set variable "z"} abc ghi}
+} {1 {can't set "z": variable is array} abc ghi}
test scan-4.61 {Tcl_ScanObjCmd, set errors} {
set x {}
catch {unset y}; array set y {}
@@ -334,7 +338,7 @@ test scan-4.61 {Tcl_ScanObjCmd, set errors} {
unset y
unset z
set result
-} {1 {couldn't set variable "z"couldn't set variable "y"} abc}
+} {1 {can't set "z": variable is array} abc}
# procedure that returns the range of integers
@@ -507,7 +511,7 @@ test scan-8.1 {error conditions} {
test scan-8.2 {error conditions} {
catch {scan a} msg
set msg
-} {wrong # args: should be "scan string format ?varName varName ...?"}
+} {wrong # args: should be "scan string format ?varName ...?"}
test scan-8.3 {error conditions} {
list [catch {scan a %D x} msg] $msg
} {1 {bad scan conversion character "D"}}
@@ -541,27 +545,27 @@ test scan-8.12 {error conditions} {
catch {unset a}
set a(0) 44
list [catch {scan 44 %d a} msg] $msg
-} {1 {couldn't set variable "a"}}
+} {1 {can't set "a": variable is array}}
test scan-8.13 {error conditions} {
catch {unset a}
set a(0) 44
list [catch {scan 44 %c a} msg] $msg
-} {1 {couldn't set variable "a"}}
+} {1 {can't set "a": variable is array}}
test scan-8.14 {error conditions} {
catch {unset a}
set a(0) 44
list [catch {scan 44 %s a} msg] $msg
-} {1 {couldn't set variable "a"}}
+} {1 {can't set "a": variable is array}}
test scan-8.15 {error conditions} {
catch {unset a}
set a(0) 44
list [catch {scan 44 %f a} msg] $msg
-} {1 {couldn't set variable "a"}}
+} {1 {can't set "a": variable is array}}
test scan-8.16 {error conditions} {
catch {unset a}
set a(0) 44
list [catch {scan 44 %f a} msg] $msg
-} {1 {couldn't set variable "a"}}
+} {1 {can't set "a": variable is array}}
catch {unset a}
test scan-8.17 {error conditions} {
list [catch {scan 44 %2c a} msg] $msg