From 20890b1cf3bb1540271631ad085f9a1378aedd7b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 16 Sep 2007 14:41:39 +0000 Subject: [PATCH] fix date test for machines with 64-bit dates svn: r7355 --- collects/tests/mzscheme/date.ss | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/collects/tests/mzscheme/date.ss b/collects/tests/mzscheme/date.ss index 2c9526ec10..e210dd3525 100644 --- a/collects/tests/mzscheme/date.ss +++ b/collects/tests/mzscheme/date.ss @@ -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)