1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-04 05:50:26 +02:00
guile/test-suite/tests/gc.test
2003-04-05 19:15:35 +00:00

42 lines
1.2 KiB
Scheme

;;;; gc.test --- test guile's garbage collection -*- scheme -*-
;;;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
;;;;
;;;; 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 2.1 of the License, or (at your option) any later version.
;;;;
;;;; 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
;;;; Lesser General Public License for more details.
;;;;
;;;; 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(use-modules (ice-9 documentation))
;;;
;;; miscellaneous
;;;
(define (documented? object)
(not (not (object-documentation object))))
;;;
;;;
;;;
(with-test-prefix "gc"
(pass-if "after-gc-hook gets called"
(let* ((foo #f)
(thunk (lambda () (set! foo #t))))
(add-hook! after-gc-hook thunk)
(gc)
(remove-hook! after-gc-hook thunk)
foo)))