deftest uses the wrong package name for the name of a test
guicho271828 opened this issue · 3 comments
guicho271828 commented
example:
(defpackage a
(:use :cl))
(in-package :a)
(defclass c () ())
(defpackage a-test
(:use :cl
:cl-test-more
:a))
(in-package :a-test)
(deftest c
(diag "hi")
(ok t))
(find-tests-of-package :a-test)
;; -> nil
(find-tests-of-package :a)
;; -> '((a:c #<function>))
the problem is in here:
;; in the last part of deftest
(push (cons ',name
,test-fn)
*tests*)
and in here:
;; in find-tests-of-package
(eq (symbol-package (car test))
package)
in this case you should intern a name for the test.
i would try to fix it.
guicho271828 commented
the error-case above was incorrect.
instead:
(defpackage a
(:use :cl)
(:export :c))
(in-package :a)
(defclass c () ())
yes, the problem occurs because the symbol is exported.
fukamachi commented
This must be a bug. I'll fix this.
Use a different test name for instead until then.
guicho271828 commented
ah I think my last commit includes the change in the way it stores the information about the tests.
(related to run-tests-recursively)
It is now able to handle the problem and the bug is already fixed. Take a look.
sorry for the delayed report. I shouldve told you about it first.