+(defun test-step-next/2 ()
+ (let* ((results nil)
+ (expected '(("(IN)" ())
+ ("(PRINT 1)" (1))
+ ("(PRINT 2)" (2))
+ ("(PRINT 3)" (3))
+ ("(PRINT 4)" (4))))
+ (count 0)
+ (*stepper-hook* (lambda (condition)
+ (typecase condition
+ (step-form-condition
+ (push (list (step-condition-form condition)
+ (step-condition-args condition))
+ results)
+ (if (>= (incf count) 3)
+ (invoke-restart 'step-into)
+ (invoke-restart 'step-into)))))))
+ (step (out))
+ (assert (equal expected (reverse results)))))
+
+(defun test-step-out/2 ()
+ (let* ((results nil)
+ (expected '(("(IN)" ())
+ ("(PRINT 1)" (1))
+ ("(PRINT 2)" (2))))
+ (count 0)
+ (*stepper-hook* (lambda (condition)
+ (typecase condition
+ (step-form-condition
+ (push (list (step-condition-form condition)
+ (step-condition-args condition))
+ results)
+ (if (>= (incf count) 3)
+ (invoke-restart 'step-out)
+ (invoke-restart 'step-into)))))))
+ (step (out))
+ (assert (equal expected (reverse results)))))
+