summaryrefslogtreecommitdiffstats
path: root/tests/util.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util.test')
-rw-r--r--tests/util.test29
1 files changed, 19 insertions, 10 deletions
diff --git a/tests/util.test b/tests/util.test
index 61a1790..0e50483 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -12,6 +12,10 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
namespace import -force ::tcltest::*
}
+::tcltest::loadTestedCommands
+catch [list package require -exact Tcltest [info patchlevel]]
+
+testConstraint controversialNaN 1
testConstraint testdstring [llength [info commands testdstring]]
testConstraint testconcatobj [llength [info commands testconcatobj]]
testConstraint testdoubledigits [llength [info commands testdoubledigits]]
@@ -1143,22 +1147,26 @@ test util-11.23 {Tcl_PrintDouble - scaling} {
expr 1.1e17
} {1.1e+17}
-test util-12.1 {Tcl_DoubleDigits - Inf} {testdoubledigits ieeeFloatingPoint} {
+test util-12.1 {TclDoubleDigits - Inf} {testdoubledigits ieeeFloatingPoint} {
testdoubledigits Inf -1 shortest
} {Infinity 9999 +}
-test util-12.2 {Tcl_DoubleDigits - -Inf} {testdoubledigits ieeeFloatingPoint} {
+test util-12.2 {TclDoubleDigits - -Inf} {testdoubledigits ieeeFloatingPoint} {
testdoubledigits -Inf -1 shortest
} {Infinity 9999 -}
-test util-12.3 {Tcl_DoubleDigits - NaN} {testdoubledigits ieeeFloatingPoint} {
+test util-12.3 {TclDoubleDigits - NaN} {testdoubledigits ieeeFloatingPoint} {
testdoubledigits $ieeeValues(NaN) -1 shortest
} {NaN 9999 +}
-test util-12.4 {Tcl_DoubleDigits - NaN} {testdoubledigits ieeeFloatingPoint} {
- testdoubledigits -NaN -1 shortest
-} {NaN 9999 -}
-test util-12.5 {Tcl_DoubleDigits - 0} testdoubledigits {
+test util-12.4 {TclDoubleDigits - NaN} {*}{
+ -constraints {testdoubledigits ieeeFloatingPoint controversialNaN}
+ -body {
+ testdoubledigits -NaN -1 shortest
+ }
+ -result {NaN 9999 -}
+}
+test util-12.5 {TclDoubleDigits - 0} testdoubledigits {
testdoubledigits 0.0 -1 shortest
} {0 0 +}
-test util-12.6 {Tcl_DoubleDigits - -0} testdoubledigits {
+test util-12.6 {TclDoubleDigits - -0} testdoubledigits {
testdoubledigits -0.0 -1 shortest
} {0 0 -}
@@ -2007,7 +2015,7 @@ test util-13.120 {just under half ulp - 11 digits} {*}{
}
test util-14.1 {funky NaN} {*}{
- -constraints ieeeFloatingPoint
+ -constraints {ieeeFloatingPoint controversialNaN}
-body {
set ieeeValues(-NaN)
}
@@ -2015,7 +2023,7 @@ test util-14.1 {funky NaN} {*}{
}
test util-14.2 {funky NaN} {*}{
- -constraints ieeeFloatingPoint
+ -constraints {ieeeFloatingPoint controversialNaN}
-body {
set ieeeValues(-NaN(3456789abcdef))
}
@@ -4009,6 +4017,7 @@ test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} {
}]
set ::tcl_precision $saved_precision
+
# cleanup
::tcltest::cleanupTests
return