diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-07-10 10:39:06 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-07-10 10:39:06 (GMT) |
commit | f5fb87d34132ee935284b30221c96663fcb2b2cb (patch) | |
tree | 6d41c3ac0b18e046a303633a28c4fd0caa1a3797 /tests/clock.test | |
parent | 9fca62d042d94b5c90dca523c57a9f6b83eb1cd2 (diff) | |
parent | ae39d915c8de190f44a3b6989665dd1e92b07727 (diff) | |
download | tcl-f5fb87d34132ee935284b30221c96663fcb2b2cb.zip tcl-f5fb87d34132ee935284b30221c96663fcb2b2cb.tar.gz tcl-f5fb87d34132ee935284b30221c96663fcb2b2cb.tar.bz2 |
Merge 8.6
Diffstat (limited to 'tests/clock.test')
-rw-r--r-- | tests/clock.test | 101 |
1 files changed, 64 insertions, 37 deletions
diff --git a/tests/clock.test b/tests/clock.test index faa3bcd..1ac626c 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -250,7 +250,6 @@ proc ::testClock::registry { cmd path key } { return [dict get $reg $path $key] } - # Test some of the basics of [clock format] test clock-1.0 "clock format - wrong # args" { @@ -35631,7 +35630,6 @@ test clock-34.11 {clock scan tests} { set time [clock scan "1/1/37" -gmt true] clock format $time -format {%b %d,%Y %H:%M GMT} -gmt true } {Jan 01,2037 00:00 GMT} - test clock-34.12 {clock scan, relative times} { set time [clock scan "Oct 23, 1992 -1 day"] clock format $time -format {%b %d, %Y} @@ -35660,30 +35658,6 @@ test clock-34.18 {clock scan, ISO 8601 point in time format} { set time [clock scan "19921023T000000"] clock format $time -format {%b %d, %Y %H:%M:%S} } "Oct 23, 1992 00:00:00" -test clock-34.19 {clock scan, ISO 8601 point in time format} { - set time [clock scan "19921023T00:00:00"] - clock format $time -format {%b %d, %Y %H:%M:%S} -} "Oct 23, 1992 00:00:00" -test clock-34.20 {clock scan, ISO 8601 point in time format} { - set time [clock scan "1992-10-23T00:00:00"] - clock format $time -format {%b %d, %Y %H:%M:%S} -} "Oct 23, 1992 00:00:00" -test clock-34.21 {clock scan, ISO 8601 invalid TZ} -body { - set time [clock scan "19921023MST000000"] - clock format $time -format {%b %d, %Y %H:%M:%S} -} -returnCodes error -match glob -result {unable to convert date-time string*} -test clock-34.22 {clock scan, ISO 8601 invalid TZ} -body { - set time [clock scan "19921023M000000"] - clock format $time -format {%b %d, %Y %H:%M:%S} -} -returnCodes error -match glob -result {unable to convert date-time string*} -test clock-34.23 {clock scan, ISO 8601 invalid TZ} -body { - set time [clock scan "1992-10-23M00:00:00"] - clock format $time -format {%b %d, %Y %H:%M:%S} -} -returnCodes error -match glob -result {unable to convert date-time string*} -test clock-34.24 {clock scan, ISO 8601 invalid TZ} -body { - set time [clock scan "1992-10-23MST00:00:00"] - clock format $time -format {%b %d, %Y %H:%M:%S} -} -returnCodes error -match glob -result {unable to convert date-time string*} # CLOCK SCAN REAL TESTS # We use 5am PST, 31-12-1999 as the base for these scans because irrespective @@ -35807,7 +35781,6 @@ test clock-34.43 {last monday in november} { } set res } {1991-11-25 1992-11-30 1993-11-29 1994-11-28 1995-11-27 1996-11-25} - test clock-34.44 {2nd monday in november} { set res {} foreach i {91 92 93 94 95 96} { @@ -35840,38 +35813,95 @@ test clock-34.47 {ago with multiple relative units} { set res [clock scan "2 days 2 hours ago" -base $base] expr {$base - $res} } 180000 - test clock-34.48 {more than one ToD} {*}{ -body {clock scan {10:00 11:00}} -returnCodes error -result {unable to convert date-time string "10:00 11:00": more than one time of day in string} } - test clock-34.49 {more than one date} {*}{ -body {clock scan {1/1/2001 2/2/2002}} -returnCodes error -result {unable to convert date-time string "1/1/2001 2/2/2002": more than one date in string} } - test clock-34.50 {more than one time zone} {*}{ -body {clock scan {10:00 EST CST}} -returnCodes error -result {unable to convert date-time string "10:00 EST CST": more than one time zone in string} } - test clock-34.51 {more than one weekday} {*}{ -body {clock scan {Monday Tuesday}} -returnCodes error -result {unable to convert date-time string "Monday Tuesday": more than one weekday in string} } - test clock-34.52 {more than one ordinal month} {*}{ -body {clock scan {next January next March}} -returnCodes error -result {unable to convert date-time string "next January next March": more than one ordinal month in string} } - - +test clock-34.53 {clock scan, ISO 8601 point in time format} { + set time [clock scan "19921023T00:00:00"] + clock format $time -format {%b %d, %Y %H:%M:%S} +} "Oct 23, 1992 00:00:00" +test clock-34.54 {clock scan, ISO 8601 point in time format} { + set time [clock scan "1992-10-23T00:00:00"] + clock format $time -format {%b %d, %Y %H:%M:%S} +} "Oct 23, 1992 00:00:00" +test clock-34.55 {clock scan, ISO 8601 invalid TZ} -body { + set time [clock scan "19921023MST000000"] + clock format $time -format {%b %d, %Y %H:%M:%S} +} -returnCodes error -match glob -result {unable to convert date-time string*} +test clock-34.56 {clock scan, ISO 8601 invalid TZ} -body { + set time [clock scan "19921023M000000"] + clock format $time -format {%b %d, %Y %H:%M:%S} +} -returnCodes error -match glob -result {unable to convert date-time string*} +test clock-34.57 {clock scan, ISO 8601 invalid TZ} -body { + set time [clock scan "1992-10-23M00:00:00"] + clock format $time -format {%b %d, %Y %H:%M:%S} +} -returnCodes error -match glob -result {unable to convert date-time string*} +test clock-34.58 {clock scan, ISO 8601 invalid TZ} -body { + set time [clock scan "1992-10-23MST00:00:00"] + clock format $time -format {%b %d, %Y %H:%M:%S} +} -returnCodes error -match glob -result {unable to convert date-time string*} +test clock-34.59 {clock scan tests (-TZ)} { + set time [clock scan "31 Jan 14 23:59:59 -0100"] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Feb 01,2014 00:59:59 GMT} +test clock-34.60 {clock scan tests (+TZ)} { + set time [clock scan "31 Jan 14 23:59:59 +0100"] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 31,2014 22:59:59 GMT} +test clock-34.61 {clock scan tests (-TZ)} { + set time [clock scan "23:59:59 -0100" -base 0] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 02,1970 00:59:59 GMT} +test clock-34.62 {clock scan tests (+TZ)} { + set time [clock scan "23:59:59 +0100" -base 0] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 01,1970 22:59:59 GMT} +test clock-34.63 {clock scan tests (TZ)} { + set time [clock scan "Mon, 30 Jun 2014 23:59:59 CEST"] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jun 30,2014 21:59:59 GMT} +test clock-34.64 {clock scan tests (TZ)} { + set time [clock scan "Fri, 31 Jan 2014 23:59:59 CET"] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 31,2014 22:59:59 GMT} +test clock-34.65 {clock scan tests (relspec, day unit not TZ)} { + set time [clock scan "23:59:59 +15 day" -base 2000000 -gmt true] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Feb 08,1970 23:59:59 GMT} +test clock-34.66 {clock scan tests (relspec, day unit not TZ)} { + set time [clock scan "23:59:59 -15 day" -base 2000000 -gmt true] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 09,1970 23:59:59 GMT} +test clock-34.67 {clock scan tests (merid and TZ)} { + set time [clock scan "10:59 pm CET" -base 2000000] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 24,1970 21:59:00 GMT} +test clock-34.68 {clock scan tests (merid and TZ)} { + set time [clock scan "10:59 pm +0100" -base 2000000] + clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true +} {Jan 24,1970 21:59:00 GMT} # clock seconds test clock-35.1 {clock seconds tests} { @@ -36971,12 +37001,10 @@ 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] @@ -36988,7 +37016,6 @@ test clock-67.4 {Change format %x output on global locale change [Bug 4a0c163d24 } -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] |