diff options
author | Andreas Rottmann <a.rottmann@gmx.at> | 2011-03-20 01:00:09 +0100 |
---|---|---|
committer | Andreas Rottmann <a.rottmann@gmx.at> | 2011-03-20 01:00:09 +0100 |
commit | 13f1461c2417cc80f050beb4c11a94deb60defae (patch) | |
tree | 752bedc6f24892d08f406c9e6a746195cc0706ac /test-suite/vm | |
parent | 75847d5767df6321adcd47e92d1a986333d4e9bd (diff) |
Add VM test for call/cc in non-tail position
* test-suite/vm/t-call-cc.scm: Add test case using call/cc in a non-tail
position.
Diffstat (limited to 'test-suite/vm')
-rw-r--r-- | test-suite/vm/t-call-cc.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test-suite/vm/t-call-cc.scm b/test-suite/vm/t-call-cc.scm index 05e4de98c..097f276ff 100644 --- a/test-suite/vm/t-call-cc.scm +++ b/test-suite/vm/t-call-cc.scm @@ -14,3 +14,17 @@ (else (set-counter2 (1+ counter2)))))) (loop 0)) + +(let* ((next #f) + (counter 0) + (result (call/cc + (lambda (k) + (set! next k) + 1)))) + (set! counter (+ 1 counter)) + (cond ((not (= counter result)) + (error "bad call/cc behaviour" counter result)) + ((> counter 10) + #t) + (else + (next (+ 1 counter))))) |