summaryrefslogtreecommitdiffstats
path: root/tests/util.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util.test')
-rw-r--r--tests/util.test28
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/util.test b/tests/util.test
index c910b43..15457da 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -12,6 +12,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
namespace import -force ::tcltest::*
}
+testConstraint controversialNaN 1
testConstraint testdstring [llength [info commands testdstring]]
testConstraint testconcatobj [llength [info commands testconcatobj]]
@@ -1142,22 +1143,26 @@ test util-11.23 {Tcl_PrintDouble - scaling} {
expr 1.1e17
} {1.1e+17}
-test util-12.1 {Tcl_DoubleDigits - Inf} ieeeFloatingPoint {
+test util-12.1 {TclDoubleDigits - Inf} ieeeFloatingPoint {
testdoubledigits Inf -1 shortest
} {Infinity 9999 +}
-test util-12.2 {Tcl_DoubleDigits - -Inf} ieeeFloatingPoint {
+test util-12.2 {TclDoubleDigits - -Inf} ieeeFloatingPoint {
testdoubledigits -Inf -1 shortest
} {Infinity 9999 -}
-test util-12.3 {Tcl_DoubleDigits - NaN} ieeeFloatingPoint {
+test util-12.3 {TclDoubleDigits - NaN} ieeeFloatingPoint {
testdoubledigits $ieeeValues(NaN) -1 shortest
} {NaN 9999 +}
-test util-12.4 {Tcl_DoubleDigits - NaN} ieeeFloatingPoint {
- testdoubledigits -NaN -1 shortest
-} {NaN 9999 -}
-test util-12.5 {Tcl_DoubleDigits - 0} {
+test util-12.4 {TclDoubleDigits - NaN} {*}{
+ -constraints {ieeeFloatingPoint && controversialNaN}
+ -body {
+ testdoubledigits -NaN -1 shortest
+ }
+ -result {NaN 9999 -}
+}
+test util-12.5 {TclDoubleDigits - 0} {
testdoubledigits 0.0 -1 shortest
} {0 0 +}
-test util-12.6 {Tcl_DoubleDigits - -0} {
+test util-12.6 {TclDoubleDigits - -0} {
testdoubledigits -0.0 -1 shortest
} {0 0 -}
@@ -1887,7 +1892,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)
}
@@ -1895,7 +1900,7 @@ test util-14.1 {funky NaN} {*}{
}
test util-14.2 {funky NaN} {*}{
- -constraints ieeeFloatingPoint
+ -constraints {ieeeFloatingPoint && controversialNaN}
-body {
set ieeeValues(-NaN(3456789abcdef))
}
@@ -3889,10 +3894,11 @@ test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} {
}]
set ::tcl_precision $saved_precision
+
# cleanup
::tcltest::cleanupTests
return
# Local Variables:
# mode: tcl
-# End:
+# End: \ No newline at end of file