diff options
author | hobbs <hobbs> | 2002-02-07 01:50:46 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-02-07 01:50:46 (GMT) |
commit | c11c702cfe6d98893a8ac09baefbf98a868f6b32 (patch) | |
tree | ac7ba1869a3d670c5a17aa2a7643447233e371e7 /tests | |
parent | e844a773cbc0756b3cb28059a223fb56ddad5186 (diff) | |
download | tcl-c11c702cfe6d98893a8ac09baefbf98a868f6b32.zip tcl-c11c702cfe6d98893a8ac09baefbf98a868f6b32.tar.gz tcl-c11c702cfe6d98893a8ac09baefbf98a868f6b32.tar.bz2 |
* tests/scan.test:
* generic/tclScan.c (Tcl_ScanObjCmd): corrected scan 0x... %x
handling that didn't accept the 0x as a prelude to a base 16
number. [Bug #495213]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scan.test | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/scan.test b/tests/scan.test index d7204a9..d3d8c96 100644 --- a/tests/scan.test +++ b/tests/scan.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: scan.test,v 1.11 2000/12/10 03:27:04 hobbs Exp $ +# RCS: @(#) $Id: scan.test,v 1.12 2002/02/07 01:50:46 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -231,9 +231,20 @@ test scan-4.39 {Tcl_ScanObjCmd, base-16 integer scanning} { list [scan {+1238 -123a 0123} {%x%x%x} x y z] $x $y $z } {3 4664 -4666 291} test scan-4.40 {Tcl_ScanObjCmd, base-16 integer scanning} { + # The behavior changed in 8.4a4/8.3.4cvs (6 Feb) to correctly + # return '1' for 0x1 scanned via %x, to comply with 8.0 and C scanf. + # Bug #495213 set x {} list [scan {aBcDeF AbCdEf 0x1} {%x%x%x} x y z] $x $y $z -} {3 11259375 11259375 0} +} {3 11259375 11259375 1} +test scan-4.40.1 {Tcl_ScanObjCmd, base-16 integer scanning} { + set x {} + list [scan {0xF 0x00A0B 0X0XF} {%x %x %x} x y z] $x $y $z +} {3 15 2571 0} +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.41 {Tcl_ScanObjCmd, base-unknown integer scanning} { set x {} list [scan {10 010 0x10} {%i%i%i} x y z] $x $y $z |