fix date test for machines with 64-bit dates
svn: r7355
This commit is contained in:
parent
64819add70
commit
20890b1cf3
|
@ -19,24 +19,25 @@
|
|||
(test-find 0 0 0 1 4 1975)
|
||||
(test-find 0 0 0 1 4 2005)
|
||||
|
||||
; Bad dates
|
||||
;; Bad dates
|
||||
(err/rt-test (find-seconds 0 0 0 0 0 1990) exn:fail?)
|
||||
(err/rt-test (find-seconds 0 0 0 0 1 1990) exn:fail?)
|
||||
(err/rt-test (find-seconds 0 0 0 1 0 1990) exn:fail?)
|
||||
|
||||
; Early/late
|
||||
(err/rt-test (find-seconds 0 0 0 1 1 1490) exn:fail?)
|
||||
(err/rt-test (find-seconds 0 0 0 1 1 2890) exn:fail?)
|
||||
;; Early/late
|
||||
(unless (eq? (expt 2 40) (eq-hash-code (expt 2 40))) ; 64-bit-machine?
|
||||
(err/rt-test (find-seconds 0 0 0 1 1 1490) exn:fail?)
|
||||
(err/rt-test (find-seconds 0 0 0 1 1 2890) exn:fail?))
|
||||
|
||||
; 1990 April 1 was start of daylight savings:
|
||||
;; 1990 April 1 was start of daylight savings:
|
||||
(test-find 0 0 1 1 4 1990) ; ok
|
||||
(let ([s (find-seconds 1 0 3 1 4 1990)]) ; ok
|
||||
(when (date-dst? (seconds->date s))
|
||||
; We have daylight savings here; 2:01 AM doesn't exist
|
||||
(err/rt-test (find-seconds 0 1 2 1 4 1990) exn:fail?)
|
||||
; This date is ambiguous; find-seconds should find
|
||||
; one of the two possible values, though:
|
||||
(test-find 0 30 1 27 10 1996)))
|
||||
;; We have daylight savings here; 2:01 AM doesn't exist
|
||||
(err/rt-test (find-seconds 0 1 2 1 4 1990) exn:fail?)
|
||||
;; This date is ambiguous; find-seconds should find
|
||||
;; one of the two possible values, though:
|
||||
(test-find 0 30 1 27 10 1996)))
|
||||
|
||||
;; bug fixes
|
||||
(test "JD 12" julian/scalinger->string 12)
|
||||
|
|
Loading…
Reference in New Issue
Block a user