summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-01-10 22:40:16 (GMT)
committersebres <sebres@users.sourceforge.net>2017-01-10 22:40:16 (GMT)
commitbc93c0f3ab88c29a0985e463ccd73fafaddddbc9 (patch)
treecca855feaafbb0568d92cc2b06cb9d8116e194c5 /tests
parent61be8dc3b8493311781e3fec5575cb85161d16ab (diff)
downloadtcl-bc93c0f3ab88c29a0985e463ccd73fafaddddbc9.zip
tcl-bc93c0f3ab88c29a0985e463ccd73fafaddddbc9.tar.gz
tcl-bc93c0f3ab88c29a0985e463ccd73fafaddddbc9.tar.bz2
min length of %Y token (year with century) is 4, optional tokens possibility (zone), test cases extended
Diffstat (limited to 'tests')
-rw-r--r--tests/clock.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 1d02f39..a4641c6 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -18587,6 +18587,18 @@ test clock-6.16 {input of ambiguous short locale token (%b)} {
} result] $result $errorCode
} {1 {input string does not match supplied format} {CLOCK badInputString}}
+test clock-6.17 {spaces are always optional in non-strict mode (default)} {
+ list [clock scan "2009-06-30T18:30:00+02:00" -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1] \
+ [clock scan "2009-06-30T18:30:00 +02:00" -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1] \
+ [clock scan "2009-06-30T18:30:00Z" -format "%Y-%m-%dT%H:%M:%S %z" -timezone CET] \
+ [clock scan "2009-06-30T18:30:00 Z" -format "%Y-%m-%dT%H:%M:%S %z" -timezone CET]
+} {1246379400 1246379400 1246386600 1246386600}
+
+test clock-6.18 {zone token (%z) is optional} {
+ list [clock scan "2009-06-30T18:30:00 -01:00" -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1] \
+ [clock scan "2009-06-30T18:30:00" -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1] \
+ [clock scan " 2009-06-30T18:30:00 " -format "%Y-%m-%dT%H:%M:%S %z" -gmt 1] \
+} {1246390200 1246386600 1246386600}
test clock-7.1 {Julian Day} {
clock scan 0 -format %J -gmt true