aboutsummaryrefslogtreecommitdiff
path: root/tests/scan.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-11-01 08:45:04 +1000
committerSteve Bennett <steveb@workware.net.au>2020-11-01 08:46:47 +1000
commit8e1a22bac49a3acb1ee757ca34ed16b27bb7cd17 (patch)
tree71c1318a28025739f26deb8dd218d7369c5ec5b8 /tests/scan.test
parent2d86f2643f4a190f8f1e8c6caf0a00cad727af55 (diff)
downloadjimtcl-8e1a22bac49a3acb1ee757ca34ed16b27bb7cd17.zip
jimtcl-8e1a22bac49a3acb1ee757ca34ed16b27bb7cd17.tar.gz
jimtcl-8e1a22bac49a3acb1ee757ca34ed16b27bb7cd17.tar.bz2
scan.test: Be more lenient in floating point format
Some systems produce 5e-05 while some produce 5e-5. Both are acceptable. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/scan.test')
-rw-r--r--tests/scan.test8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/scan.test b/tests/scan.test
index 2267d22..6360c15 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -244,11 +244,11 @@ 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} {
+test scan-4.41 {Tcl_ScanObjCmd, base-unknown integer scanning} jim {
set x {}
list [scan {10 010 0x10} {%i%i%i} x y z] $x $y $z
} {3 10 10 16}
-test scan-4.42 {Tcl_ScanObjCmd, base-unknown integer scanning} {
+test scan-4.42 {Tcl_ScanObjCmd, base-unknown integer scanning} jim {
set x {}
list [scan {10 010 0X10} {%i%i%i} x y z] $x $y $z
} {3 10 10 16}
@@ -437,10 +437,10 @@ test scan-6.5 {floating-point scanning} {
set a {}; set b {}; set c {}; set d {}
list [scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d] $a $b $c $d
} {4 4.6 99999.7 87.643 118.0}
-test scan-6.6 {floating-point scanning} jim {
+test scan-6.6 {floating-point scanning} -body {
set a {}; set b {}; set c {}; set d {}
list [scan "1.2345 697.0e-3 124 .00005" "%f %e %f %e" a b c d] $a $b $c $d
-} {4 1.2345 0.697 124.0 5e-05}
+} -match regexp -result {4 1\.2345 0\.697 124.0 5e-0?5}
test scan-6.7 {floating-point scanning} {
set a {}; set b {}; set c {}; set d {}
list [scan "4.6abc" "%f %f %f %f" a b c d] $a $b $c $d