-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathtest-defsystem-errors.script
30 lines (25 loc) · 1 KB
/
test-defsystem-errors.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;;; -*- Lisp -*-
(defun defsystem-error-handler (form &optional (error 'error))
(declare (ignore error))
(handler-case (eval form)
(error () t)
(:no-error (&rest values)
(declare (ignore values))
(error "Expected an error out of ~S" form))))
(defmacro defsystem-error ((&optional (error 'error)) &rest r)
`(defsystem-error-handler '(def-test-system ,@r) ',error))
(defsystem-error (non-system-system)
:foo :class :cl-source-file)
(defsystem-error (non-toplevel-system)
:foo :components ((:system :bar)))
;;; test for my kluge for cl-ppcre
(assert
(catch 'bad-name-warn
(handler-bind
((bad-system-name #'(lambda (c)
(declare (ignorable c))
(format t "~&Catching bad name warning: ~A~%" c)
(throw 'bad-name-warn nil))))
(let ((asdf::*known-systems-with-bad-secondary-system-names*
(list-to-hash-set '("test-bad-system-name"))))
(find-system "test-bad-system-name")))))