summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-01-25 19:03:29 +0100
committerAndy Wingo <wingo@pobox.com>2012-01-25 19:03:50 +0100
commita2b62b48ab92ed1b5e5e0bcc292498abba3154cb (patch)
tree635ecaefa13f67c08e6fd7bc844ce7a23fdcfe30
parente5cf97290c3d2dcda0eca02f9fcf4020452bca42 (diff)
downloadguile-a2b62b48ab92ed1b5e5e0bcc292498abba3154cb.tar.gz
fix "lexical vars are collectable" test
* test-suite/tests/gc.test ("gc"): Fix "lexical vars are collectable" test. (Previously, the binding was getting inlined, so we weren't testing what we meant to test. Besides that, the value was a constant, not a closure, so it wasn't collectable in the first place!)
-rw-r--r--test-suite/tests/gc.test9
1 files changed, 6 insertions, 3 deletions
diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
index 25dc5779d..527bef56c 100644
--- a/test-suite/tests/gc.test
+++ b/test-suite/tests/gc.test
@@ -1,6 +1,6 @@
;;;; gc.test --- test guile's garbage collection -*- scheme -*-
;;;; Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009,
-;;;; 2011 Free Software Foundation, Inc.
+;;;; 2011, 2012 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
@@ -87,11 +87,14 @@
total)))
(pass-if "Lexical vars are collectable"
- (procedure?
+ (list?
(compile
'(begin
(define guardian (make-guardian))
- (let ((f (lambda () (display "test\n"))))
+ (let ((f (list 'foo)))
+ ;; Introduce a useless second reference to f to prevent the
+ ;; optimizer from propagating the lexical binding.
+ f
(guardian f))
(gc)(gc)(gc)
(guardian))))))