diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-09-06 18:41:03 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-09-06 18:41:03 +0000 |
commit | c00b93eaa4ec01355475ab5065765bb7fece3c8b (patch) | |
tree | 6fc3ce2e932b344caa07ab49f7997f08cdc412bc | |
parent | ffe70f9c28b9cbbc7c1ead7447b3aaa07d58b990 (diff) | |
download | guile-c00b93eaa4ec01355475ab5065765bb7fece3c8b.tar.gz |
* tests/interp.test: Added tests for evaluation of closure bodies.
-rw-r--r-- | test-suite/tests/interp.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test-suite/tests/interp.test b/test-suite/tests/interp.test index 18218d6d3..db3f63494 100644 --- a/test-suite/tests/interp.test +++ b/test-suite/tests/interp.test @@ -14,3 +14,24 @@ (retfoo (lambda () foo))) (define baz (retfoo)) (retfoo))) + +;; Test that evaluation of closure bodies works as it should + +(with-test-prefix "closure bodies" + (with-test-prefix "eval" + (pass-if "expansion" + ;; we really want exactly #f back from the closure + (not ((lambda () (define ret #f) ret)))) + (pass-if "iloc escape" + (not (let* ((x #f) + (foo (lambda () x))) + (foo) ; causes memoization of x + (foo))))) + (with-test-prefix "apply" + (pass-if "expansion" + (not (catch #t (lambda () (define ret #f) ret) (lambda a #t)))) + (pass-if "iloc escape" + (not (let* ((x #f) + (foo (lambda () x))) + (foo) + (catch #t foo (lambda a #t))))))) |