From aa01ebaef50cb2919619fea3b464a5653c90bc77 Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Sun, 23 Mar 2003 17:29:50 +0000 Subject: [PATCH] Tests for invoke-restart-interactively in restart-bind and restart-case. --- ansi-tests/restart-bind.lsp | 21 +++++++++++++++++---- ansi-tests/restart-case.lsp | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/ansi-tests/restart-bind.lsp b/ansi-tests/restart-bind.lsp index d075621d..143d9716 100644 --- a/ansi-tests/restart-bind.lsp +++ b/ansi-tests/restart-bind.lsp @@ -202,9 +202,22 @@ (invoke-restart 'foo))) program-error) -;;; Must still add interactive-function tests - - - +(deftest restart-bind.23 + (restart-bind + ((foo #'(lambda () 'good))) + (invoke-restart-interactively 'foo)) + good) +(deftest restart-bind.24 + (let ((i 0)) + (values + (restart-bind + ((foo + #'(lambda (x y z) (list z y x)) + :interactive-function (progn (incf i) + #'(lambda () (list 'a 'b 'c))))) + (invoke-restart-interactively 'foo)) + i)) + (c b a) + 1) diff --git a/ansi-tests/restart-case.lsp b/ansi-tests/restart-case.lsp index 594363d6..3915221e 100644 --- a/ansi-tests/restart-case.lsp +++ b/ansi-tests/restart-case.lsp @@ -264,6 +264,30 @@ (foo () 'good)))))) good) +(deftest restart-case.32 + (restart-case + (invoke-restart-interactively 'foo) + (foo () 'good)) + good) + +(deftest restart-case.33 + (restart-case + (invoke-restart-interactively 'foo) + (foo (w x y z) + :interactive (lambda () (list 'a 'b 'c 'd)) + (list x w z y))) + (b a d c)) + +(deftest restart-case.34 + (flet ((%f () (list 'a 'b 'c 'd))) + (restart-case + (invoke-restart-interactively 'foo) + (foo (w x y z) + :interactive %f + (list x w z y)))) + (b a d c)) + + -- GitLab