Use #:duplicates (last) to
[bpt/guile.git] / test-suite / tests / srfi-19.test
index 75eb256..4300bf0 100644 (file)
@@ -1,7 +1,7 @@
 ;;;; srfi-19.test --- test suite for SRFI-19 -*- scheme -*-
 ;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
 ;;;;
-;;;;   Copyright (C) 2001 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
 ;;;;
 ;;;; This program is free software; you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 ;; separate module, or later tests will fail.
 
 (define-module (test-suite test-srfi-19)
+  :duplicates (last)  ;; avoid warning about srfi-19 replacing `current-time'
   :use-module (test-suite lib)
   :use-module (srfi srfi-19)
   :use-module (ice-9 format))
@@ -65,12 +66,12 @@ incomplete numerical tower implementation.)"
   (pass-if (format "~A respects local DST if no TZ-OFFSET given"
                   time->date)
           (let ((time (date->time (make-date 0 0 0 12 1 6 2001 0))))
-            ;; on 2001-06-01, there should be two hours zone offset
-            ;; between CET (CEST) and GMT
+            ;; on 2001-06-01, there should be 4 hours zone offset
+            ;; between EST (EDT) and GMT
             (= (date-zone-offset
-                (with-tz "CET"
+                (with-tz "EST5EDT"
                   (time->date time)))
-               7200))))
+               -14400))))
 
 (define-macro (test-time-conversion a b)
   (let* ((a->b-sym (symbol-append a '-> b))
@@ -131,8 +132,8 @@ incomplete numerical tower implementation.)"
   (test-dst modified-julian-day->date date->modified-julian-day)
   (pass-if "string->date respects local DST if no time zone is read"
           (time=? (date->time-utc
-                   (with-tz "CET"
-                     (string->date "2001-06-01@14:00" "~Y-~m-~d@~H:~M")))
+                   (with-tz "EST5EDT"
+                     (string->date "2001-06-01@08:00" "~Y-~m-~d@~H:~M")))
                   (date->time-utc
                    (make-date 0 0 0 12 1 6 2001 0))))
   ;; check time comparison procedures
@@ -150,7 +151,13 @@ incomplete numerical tower implementation.)"
          (time2 (make-time time-monotonic 385907 998360432))
          (diff (time-difference time2 time1)))
     (test-time-arithmetic add-duration time1 diff time2)
-    (test-time-arithmetic subtract-duration time2 diff time1)))
+    (test-time-arithmetic subtract-duration time2 diff time1))
+
+  (with-test-prefix "date-week-number"
+    (pass-if (= 0 (date-week-number (make-date 0 0 0 0 1 1 1984 0) 0)))
+    (pass-if (= 0 (date-week-number (make-date 0 0 0 0 7 1 1984 0) 0)))
+    (pass-if (= 1 (date-week-number (make-date 0 0 0 0 8 1 1984 0) 0)))))
+
 
 ;; Local Variables:
 ;; eval: (put 'with-tz 'scheme-indent-function 1)