Add test checking whether fluids are GC'd.
authorLudovic Courtès <ludo@gnu.org>
Tue, 2 Mar 2010 23:36:41 +0000 (00:36 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 2 Mar 2010 23:36:41 +0000 (00:36 +0100)
* test-suite/tests/fluids.test ("fluids are GC'd"): New test.

test-suite/tests/fluids.test

index f00fdc4..51353fa 100644 (file)
                        (a 2))
            (eqv? (fluid-ref a) 2))
          (eqv? (fluid-ref a) #f))))
+
+(pass-if "fluids are GC'd"
+
+  (let ((g (make-guardian)))
+    (g (make-fluid))
+    (let loop ((i 1000))
+      (and (> i 0)
+           (begin
+             (make-fluid)
+             (loop (1- i)))))
+    (gc)
+    (fluid? (g))))