Skip to content

Commit

Permalink
more syntax checking for task-handler-bind
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj committed Nov 6, 2014
1 parent 77516ae commit 9c65e4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kernel/handling.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ that were created in `body'."
(let ((forms (loop
:for clause :in clauses
:for (name fn . more) := clause
:do (unless (and (symbolp name) (not more))
(error "Wrong format in TASK-HANDLER-BIND clause: ~a"
:do (unless (and name (symbolp name) fn (not more))
(error "Ill-formed binding in `task-handler-bind': ~a"
clause))
:collect `(cons ',name ,fn))))
`(let ((*client-handlers* (list* ,@forms *client-handlers*)))
Expand Down
10 changes: 10 additions & 0 deletions test/kernel-test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,16 @@
(is (equal '(inner outer)
(extract-queue q)))))

(base-test task-handler-bind-syntax-test
(signals error
(macroexpand '(task-handler-bind ((())))))
(signals error
(macroexpand '(task-handler-bind (()))))
(signals error
(macroexpand '(task-handler-bind ((x)))))
(signals error
(macroexpand '(task-handler-bind ((x y z))))))

(full-test print-kernel-test
(is (plusp (length (with-output-to-string (s)
(print *kernel* s))))))
Expand Down

0 comments on commit 9c65e4f

Please sign in to comment.