Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

deftest uses the wrong package name for the name of a test #3

Open
guicho271828 opened this issue Oct 24, 2012 · 3 comments
Open

deftest uses the wrong package name for the name of a test #3

guicho271828 opened this issue Oct 24, 2012 · 3 comments

Comments

@guicho271828
Copy link

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
Copy link
Author

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
Copy link
Owner

This must be a bug. I'll fix this.

Use a different test name for instead until then.

@guicho271828
Copy link
Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants