summaryrefslogtreecommitdiff
path: root/test-suite/tests/srfi-19.test
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-12-18 22:34:23 +0100
committerLudovic Courtès <ludo@gnu.org>2008-12-18 22:49:13 +0100
commit8891556e50be2609f7dd7daaecfac150415b6331 (patch)
tree521b2883db50a60dcf86272fb4da5651a4b2da8d /test-suite/tests/srfi-19.test
parent55aae983565cd14821d4cdff9f44afc96f8868c1 (diff)
downloadguile-8891556e50be2609f7dd7daaecfac150415b6331.tar.gz
srfi-19: Fix `string->date' weekday lookup.
* srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Use `locale-day-short' since it expects integers in the range 1-7, unlike `priv:locale-abbr-weekday'. (priv:locale-long-weekday->index): Likewise. * test-suite/tests/srfi-19.test ("SRFI date/time library")["string->date works on Sunday"]: New test.
Diffstat (limited to 'test-suite/tests/srfi-19.test')
-rw-r--r--test-suite/tests/srfi-19.test10
1 files changed, 9 insertions, 1 deletions
diff --git a/test-suite/tests/srfi-19.test b/test-suite/tests/srfi-19.test
index a553ce4f8..259a88a4e 100644
--- a/test-suite/tests/srfi-19.test
+++ b/test-suite/tests/srfi-19.test
@@ -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, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008 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
@@ -166,6 +166,14 @@ incomplete numerical tower implementation.)"
0)))
(date->time-utc
(make-date 0 0 0 0 9 12 2006 0))))
+
+ (pass-if "string->date works on Sunday"
+ ;; `string->date' never rests!
+ (let* ((str "Sun, 05 Jun 2005 18:33:00 +0200")
+ (date (string->date str "~a, ~d ~b ~Y ~H:~M:~S ~z")))
+ (equal? "Sun Jun 05 18:33:00+0200 2005"
+ (date->string date))))
+
;; check time comparison procedures
(let* ((time1 (make-time time-monotonic 0 0))
(time2 (make-time time-monotonic 0 0))