diff options
author | Daniel Kraft <d@domob.eu> | 2009-07-22 12:50:56 +0200 |
---|---|---|
committer | Daniel Kraft <d@domob.eu> | 2009-07-22 12:50:56 +0200 |
commit | 33da12eeff22c5b460fc01f2e0e8fe8f85a1d220 (patch) | |
tree | 12ed209f3de8f1d10eb831408e6da0bf69f87021 /test-suite/tests/elisp-compiler.test | |
parent | 35b2e41d6d8040251a5775fc33d7158b9598ea1c (diff) | |
download | guile-33da12eeff22c5b460fc01f2e0e8fe8f85a1d220.tar.gz |
Added guile-ref extension construct, change throw implementation to easier one using a built-in function and implement unwind-protect.
* module/language/elisp/README: Document the changes.
* module/language/elisp/compile-tree-il.scm: Implement unwind-protect.
* module/language/elisp/runtime/function-slot.scm: throw as built-in.
* test-suite/tests/elisp-compiler.test: Test unwind-protect.
Diffstat (limited to 'test-suite/tests/elisp-compiler.test')
-rw-r--r-- | test-suite/tests/elisp-compiler.test | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test-suite/tests/elisp-compiler.test b/test-suite/tests/elisp-compiler.test index d70dd9fe5..cb87840a3 100644 --- a/test-suite/tests/elisp-compiler.test +++ b/test-suite/tests/elisp-compiler.test @@ -165,9 +165,20 @@ (pass-if "catch and throw" (and (setq mylist '(1 2)) (= (catch 'abc (throw 'abc 2) 1) 2) - (= (catch 'abc (catch 'def (throw 'abc 1) 2) 3) 1) + (= (catch 'abc (catch 'def (throw 'abc (1+ 0)) 2) 3) 1) (= (catch 'abc (catch 'def (throw 'def 1) 2) 3) 3) - (= (catch mylist (catch '(1 2) (throw mylist 1) 2) 3) 1)))) + (= (catch mylist (catch '(1 2) (throw mylist 1) 2) 3) 1))) + + (pass-if "unwind-protect" + (progn (setq a 0 b 1 c 1) + (catch 'exc + (unwind-protect (progn (setq a 1) + (throw 'exc 0)) + (setq a 0) + (setq b 0))) + (unwind-protect nil (setq c 0)) + (and (= a 0) (= b 0) (= c 0) + (= (unwind-protect 42 1 2 3) 42))))) ; Test handling of variables. |