add eest for escape

This commit is contained in:
zeptometer 2015-01-26 15:42:46 +09:00
parent b29f9440dc
commit 369bc4c944
1 changed files with 16 additions and 0 deletions

16
t/escape.scm Normal file
View File

@ -0,0 +1,16 @@
(import (scheme base)
(picrin control)
(picrin test))
(test-begin)
(test 1 (escape (lambda (exit) (begin (exit 1) 2))))
(define cont #f)
(test "calling dead escape continuation"
(guard (c ((error-object? c) (error-object-message c)))
(escape (lambda (exit) (set! cont exit)))
(cont 3)))
(test-end)