;;;; srfi-39.test --- -*- scheme -*-
;;;;
-;;;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+;;;; Copyright (C) 2004, 2005, 2006, 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
-;;;; the Free Software Foundation; either version 2, or (at your option)
-;;;; any later version.
+;;;; This library is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
;;;;
-;;;; This program 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
-;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;;; GNU General Public License for more details.
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;;; Lesser General Public License for more details.
;;;;
-;;;; You should have received a copy of the GNU General Public License
-;;;; along with this software; see the file COPYING. If not, write to
-;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;;;; Boston, MA 02110-1301 USA
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
(define-module (test-srfi-39)
#:use-module (test-suite lib)
- #:use-module (srfi srfi-39))
+ #:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-39)
+ #:duplicates (last) ;; avoid warning about srfi-34 replacing `raise'
+ )
(define a (make-parameter 3))
(define b (make-parameter 4))
(check c d 10 9)
(parameterize ((c (a)) (d (b)))
(and (check a b 0 1)
- (check c d 0 1)))))))
+ (check c d 0 1))))))
+
+ (pass-if "SRFI-34"
+ (let ((inside? (make-parameter #f)))
+ (call/cc (lambda (return)
+ (with-exception-handler
+ (lambda (c)
+ ;; This handler should be called in the dynamic
+ ;; environment installed by `parameterize'.
+ (return (inside?)))
+ (lambda ()
+ (parameterize ((inside? #t))
+ (raise 'some-exception)))))))))
(let ()
(define (test-ports param new-port new-port-2)