- priority: 5 --> 2
- status: open --> closed-fixed
OriginalBugID: 4022 Bug
Version: 8.3b1
SubmitDate: '2000-01-14'
LastModified: '2000-01-14'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: ericm
OS: All
FixedDate: '2000-01-14'
FixedInVersion: 8.3b2
ClosedDate: '2000-10-25'
Name:
Don Porter
CVS:
$Id: clock.test,v 1.8 2000/01/13 00:12:33 ericm Exp $
Comments:
This bug report is really for Tcl 8.3b2. The bug form
needs updating.
The tests for the new handling of a relative
[clock scan] which crosses a Daylight Savings Time boundary
are "hard coded" to the PST time zone. In PST, they test
relative scans between 1999 Oct 31 00:00:00 PST and
1999 Nov 1 00:00:00 PST, which in fact straddle a DST boundary.
In EST, those times are 1999 Oct 31 02:00:00 and
1999 Nov 1 03:00:00, which do not straddle a DST boundary.
The patch changes the tests so they work relative to
the local time zone. I think they'll work anywhere now.
I'm curious whether the revised tests will work properly
in jurisdictions like Indiana or Arizona which do not
observe DST. A test there would be appreciated.
ObservedBehavior:
$ make test
==== clock-4.25 clock scan, DST for days FAILED
==== Contents of test case:
clock scan "tomorrow" -base 941353200
---- Result was:
941439600
---- Result should have been:
941443200
==== clock-4.25 FAILED
==== clock-4.26 clock scan, DST for days FAILED
==== Contents of test case:
clock scan "yesterday" -base 941443200
---- Result was:
941356800
---- Result should have been:
941353200
==== clock-4.26 FAILED
DesiredBehavior:
No test suite failures.
Patch:
Index: clock.test
===================================================================
RCS file: /cvsroot/tcl/tests/clock.test,v
retrieving revision 1.8
diff -c -r1.8 clock.test
*** clock.test 2000/01/13 00:12:33 1.8
--- clock.test 2000/01/14 17:19:50
***************
*** 221,231 ****
-format {%b %d, %Y %H:%M:%S} -gmt true
} "Dec 31, 1999 08:00:30"
test clock-4.25 {clock scan, DST for days} {
! clock scan "tomorrow" -base 941353200
! } 941443200
test clock-4.26 {clock scan, DST for days} {
! clock scan "yesterday" -base 941443200
! } 941353200
test clock-4.27 {clock scan, day} knownBug {
clock format [clock scan "Monday" -gmt true -base 946627200] \
-format {%b %d, %Y %H:%M:%S} -gmt true
--- 221,233 ----
-format {%b %d, %Y %H:%M:%S} -gmt true
} "Dec 31, 1999 08:00:30"
test clock-4.25 {clock scan, DST for days} {
! clock format [clock scan tomorrow \
! -base [clock scan "1999-10-31 00:00:00"]] -format %H
! } 00
test clock-4.26 {clock scan, DST for days} {
! clock format [clock scan yesterday \
! -base [clock scan "1999-11-01 00:00:00"]] -format %H
! } 00
test clock-4.27 {clock scan, day} knownBug {
clock format [clock scan "Monday" -gmt true -base 946627200] \
-format {%b %d, %Y %H:%M:%S} -gmt true
PatchFiles:
tests/clock.test
Yes, the tests were hardcoded for PST. I applied your patch, with minor modification (I dropped the -format %H and made the expected result [clock scan "19991101 00:00:00"] to be sure we were getting the correct numbers).
- eric
-- 01/14/2000 ericm