summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test34
1 files changed, 30 insertions, 4 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 7d62a60..615f3a8 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -273,7 +273,7 @@ test clock-1.4 "clock format - bad flag" {*}{
list [catch {clock format 0 -oops badflag} msg] $msg $::errorCode
}
-match glob
- -result {1 {bad switch "-oops": must be -format, -gmt, -locale, or -timezone} {CLOCK badSwitch -oops}}
+ -result {1 {bad option "-oops": must be -format, -gmt, -locale, or -timezone} {CLOCK badOption -oops}}
}
test clock-1.5 "clock format - bad timezone" {
@@ -35607,7 +35607,7 @@ test clock-34.8 {clock scan tests} {
} {Oct 23,1992 15:00 GMT}
test clock-34.9 {clock scan tests} {
list [catch {clock scan "Jan 12" -bad arg} msg] $msg
-} {1 {bad switch "-bad", must be -base, -format, -gmt, -locale or -timezone}}
+} {1 {bad option "-bad", must be -base, -format, -gmt, -locale or -timezone}}
# The following two two tests test the two year date policy
test clock-34.10 {clock scan tests} {
set time [clock scan "1/1/71" -gmt true]
@@ -36905,9 +36905,9 @@ test clock-65.1 {clock add, bad option [Bug 2481670]} {*}{
-body {
clock add 0 1 year -foo bar
}
- -returnCodes error
-match glob
- -result {bad switch "-foo"*}
+ -returnCodes error
+ -result {bad option "-foo"*}
}
test clock-66.1 {clock scan, no date, never-before-seen timezone} {*}{
@@ -36931,11 +36931,37 @@ test clock-67.2 {Bug d19a30db57} -body {
# error, not segfault
tcl::clock::GetJulianDayFromEraYearMonthDay {} 2361222
} -returnCodes error -match glob -result *
+
test clock-67.3 {Bug d19a30db57} -body {
# error, not segfault
tcl::clock::GetJulianDayFromEraYearWeekDay {} 2361222
} -returnCodes error -match glob -result *
+test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24]} -setup {
+ package require msgcat
+ set current [msgcat::mclocale]
+} -body {
+ msgcat::mclocale de_de
+ set res [regexp {^\d{2}\.\d{2}\.\d{4}$} [clock format 1 -locale current -format %x]]
+ msgcat::mclocale en_uk
+ lappend res [regexp {^\d{2}/\d{2}/\d{4}$} [clock format 1 -locale current -format %x]]
+} -cleanup {
+ msgcat::mclocale $current
+} -result {1 1}
+
+test clock-67.5 {Change scan %x output on global locale change [Bug 4a0c163d24]} -setup {
+ package require msgcat
+ set current [msgcat::mclocale]
+} -body {
+ msgcat::mclocale de_de
+ set res [clock scan "01.01.1970" -locale current -format %x]
+ msgcat::mclocale en_uk
+ # This will fail without the bug fix, as still de_de is active
+ expr {$res == [clock scan "01/01/1970" -locale current -format %x]}
+} -cleanup {
+ msgcat::mclocale $current
+} -result {1}
+
# cleanup
namespace delete ::testClock