summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2018-05-29 17:27:23 (GMT)
committersebres <sebres@users.sourceforge.net>2018-05-29 17:27:23 (GMT)
commit371c0aec0b340482af2201edf522f8d036ed00cd (patch)
tree60d2d24368ca25ddb7ac72e67c551824ee65f696
parent2f35271c9deb7e3091c01e9387440d5ec1f2f09f (diff)
downloadtcl-371c0aec0b340482af2201edf522f8d036ed00cd.zip
tcl-371c0aec0b340482af2201edf522f8d036ed00cd.tar.gz
tcl-371c0aec0b340482af2201edf522f8d036ed00cd.tar.bz2
conditional test-call rewritten: realized via tests\clock-ivm.test to cover inverted default validation mode
-rw-r--r--tests/clock-ivm.test8
-rw-r--r--tests/clock.test21
2 files changed, 15 insertions, 14 deletions
diff --git a/tests/clock-ivm.test b/tests/clock-ivm.test
new file mode 100644
index 0000000..13de0b3
--- /dev/null
+++ b/tests/clock-ivm.test
@@ -0,0 +1,8 @@
+# clock-ivm.test --
+#
+# This test file covers the 'clock' command using inverted validity mode.
+#
+# See the file "clock.test" for more information.
+
+clock configure -valid [expr {![clock configure -valid]}]
+source [file join [file dirname [info script]] clock.test] \ No newline at end of file
diff --git a/tests/clock.test b/tests/clock.test
index 7c16990..72e86cb 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -34,6 +34,13 @@ testConstraint y2038 \
testConstraint no_tclclockmod \
[expr {[namespace which -command ::tcl::clock::configure] eq {}}]
+# Test with both validity modes - validate on / off:
+
+set valid_mode [clock configure -valid]
+
+puts [outputChannel] " Validity default mode: [expr {$valid_mode ? "on": "off"}]"
+testConstraint valid_off [expr {![clock configure -valid]}]
+
# TEST PLAN
# clock-0:
@@ -273,15 +280,6 @@ test clock-0.1 "initial: auto-loading of ensemble and stubs on demand" no_tclclo
set ret
} {ens:0 ens:1 stubs:0 stubs:1}
-# Test with both validity modes - validate on / off:
-
-foreach valid_mode [list [expr {![clock configure -valid]}] [clock configure -valid]] {
- clock configure -valid $valid_mode
-
- puts "Validity default mode: [expr {$valid_mode ? "on": "off"}]"
- testConstraint valid_off [expr {![clock configure -valid]}]
-
-
# Test some of the basics of [clock format]
set syntax "clock format clockval|-now ?-format string? ?-gmt boolean? ?-locale LOCALE? ?-timezone ZONE?"
@@ -37637,11 +37635,6 @@ test clock-67.5.vm$valid_mode {Change scan %x output on global locale change [Bu
::tcl::clock::ClearCaches
::tcltest::cleanupTests
-puts ""
-
-}; # foreach validate mode.
-unset -nocomplain valid_mode
-
namespace delete ::testClock
return