summaryrefslogtreecommitdiffstats
path: root/tests/util.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util.test')
-rw-r--r--tests/util.test30
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/util.test b/tests/util.test
index 7e3f962..1f214b5 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]]
@@ -1136,22 +1137,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 -}
@@ -1881,7 +1886,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)
}
@@ -1889,7 +1894,7 @@ test util-14.1 {funky NaN} {*}{
}
test util-14.2 {funky NaN} {*}{
- -constraints ieeeFloatingPoint
+ -constraints {ieeeFloatingPoint && controversialNaN}
-body {
set ieeeValues(-NaN(3456789abcdef))
}
@@ -3854,6 +3859,11 @@ test util-16.1.17.307 {8.4 compatible formatting of doubles} \
9.9999999999999999e+306
set ::tcl_precision $saved_precision
+
# cleanup
::tcltest::cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: