1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 00:10:21 +02:00

Have srfi-19.test' use the non-deprecated format' style.

* test-suite/tests/srfi-19.test: Fix all uses of `format' to pass a port
  or Boolean as the first argument.
This commit is contained in:
Ludovic Courtès 2011-01-29 21:46:44 +01:00
parent 9d46abb07b
commit 4c35b9f31c

View file

@ -1,18 +1,19 @@
;;;; srfi-19.test --- test suite for SRFI-19 -*- scheme -*- ;;;; srfi-19.test --- test suite for SRFI-19 -*- scheme -*-
;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001 ;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
;;;; ;;;;
;;;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;;;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008,
;;;; 2011 Free Software Foundation, Inc.
;;;; ;;;;
;;;; This library is free software; you can redistribute it and/or ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; modify it under the terms of the GNU Lesser General Public
;;;; License as published by the Free Software Foundation; either ;;;; License as published by the Free Software Foundation; either
;;;; version 3 of the License, or (at your option) any later version. ;;;; version 3 of the License, or (at your option) any later version.
;;;; ;;;;
;;;; This library is distributed in the hope that it will be useful, ;;;; This library is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;;; Lesser General Public License for more details. ;;;; Lesser General Public License for more details.
;;;; ;;;;
;;;; You should have received a copy of the GNU Lesser General Public ;;;; You should have received a copy of the GNU Lesser General Public
;;;; License along with this library; if not, write to the Free Software ;;;; License along with this library; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@ -36,11 +37,11 @@ value and call THUNK."
(dynamic-wind (dynamic-wind
(lambda () (lambda ()
(set! old-tz (getenv "TZ")) (set! old-tz (getenv "TZ"))
(putenv (format "TZ=~A" tz))) (putenv (format #f "TZ=~A" tz)))
thunk thunk
(lambda () (lambda ()
(if old-tz (if old-tz
(putenv (format "TZ=~A" old-tz)) (putenv (format #f "TZ=~A" old-tz))
(putenv "TZ")))))) (putenv "TZ"))))))
(defmacro with-tz (tz . body) (defmacro with-tz (tz . body)
@ -52,20 +53,20 @@ structure with integral seconds. (The seconds shall be maintained as
integers, or precision may go away silently. The SRFI-19 reference integers, or precision may go away silently. The SRFI-19 reference
implementation was not OK for Guile in this respect because of Guile's implementation was not OK for Guile in this respect because of Guile's
incomplete numerical tower implementation.)" incomplete numerical tower implementation.)"
(pass-if (format "~A makes integer seconds" (pass-if (format #f "~A makes integer seconds"
date->time) date->time)
(exact? (time-second (exact? (time-second
(date->time (make-date 0 0 0 12 1 6 2001 0)))))) (date->time (make-date 0 0 0 12 1 6 2001 0))))))
(define (test-time->date time->date date->time) (define (test-time->date time->date date->time)
(pass-if (format "~A works" (pass-if (format #f "~A works"
time->date) time->date)
(begin (begin
(time->date (date->time (make-date 0 0 0 12 1 6 2001 0))) (time->date (date->time (make-date 0 0 0 12 1 6 2001 0)))
#t))) #t)))
(define (test-dst time->date date->time) (define (test-dst time->date date->time)
(pass-if (format "~A respects local DST if no TZ-OFFSET given" (pass-if (format #f "~A respects local DST if no TZ-OFFSET given"
time->date) time->date)
(let ((time (date->time (make-date 0 0 0 12 1 6 2001 0)))) (let ((time (date->time (make-date 0 0 0 12 1 6 2001 0))))
;; on 2001-06-01, there should be 4 hours zone offset ;; on 2001-06-01, there should be 4 hours zone offset
@ -78,7 +79,7 @@ incomplete numerical tower implementation.)"
(define-macro (test-time-conversion a b) (define-macro (test-time-conversion a b)
(let* ((a->b-sym (symbol-append a '-> b)) (let* ((a->b-sym (symbol-append a '-> b))
(b->a-sym (symbol-append b '-> a))) (b->a-sym (symbol-append b '-> a)))
`(pass-if (format "~A and ~A work and are inverses of each other" `(pass-if (format #f "~A and ~A work and are inverses of each other"
',a->b-sym ',b->a-sym) ',a->b-sym ',b->a-sym)
(let ((time (make-time ,a 12345 67890123))) (let ((time (make-time ,a 12345 67890123)))
(time=? time (,b->a-sym (,a->b-sym time))))))) (time=? time (,b->a-sym (,a->b-sym time)))))))