From 369bc4c944494ff376b7b63f4f89ffff03657337 Mon Sep 17 00:00:00 2001 From: zeptometer Date: Mon, 26 Jan 2015 15:42:46 +0900 Subject: [PATCH] add eest for escape --- t/escape.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 t/escape.scm diff --git a/t/escape.scm b/t/escape.scm new file mode 100644 index 00000000..8f495a95 --- /dev/null +++ b/t/escape.scm @@ -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)