portable-condition-system icon indicating copy to clipboard operation
portable-condition-system copied to clipboard

Add test for handler-case and `:no-error`

Open NoahTheDuke opened this issue 4 years ago • 4 comments

There is no test for handler-case when :no-error is defined and an error is thrown, demonstrating that the :no-error handler is not executed. Example from the repl:

CL-USER> (let ((a nil))
           (handler-case (error "foo")
             (error () (setq a (cons "error" a)))
             (:no-error () (setq a (cons "no error" a))))
           a)
("error")

(Found in farolero#8)

NoahTheDuke avatar May 03 '21 20:05 NoahTheDuke

There's also no test for if there are two or more :no-error branches.

NoahTheDuke avatar May 04 '21 19:05 NoahTheDuke

Ping @phoe

NoahTheDuke avatar May 13 '21 00:05 NoahTheDuke

Hey - no chance for me to work on this any soon, too much on my plate at the moment. I'll gladly accept a PR and then forward it to ANSI-TEST, but I'll need someone else to write the code.

phoe avatar May 13 '21 10:05 phoe

No worries at all, this is very low importance, haha. I'll see if I can get something working!

NoahTheDuke avatar May 13 '21 13:05 NoahTheDuke