Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Store the test based on the SYMBOL-PACKAGE of the test name, not *PAC…

…KAGE*.
  • Loading branch information...
commit 04d3edf589a0c37e71617a10eccd4103f9bf1414 1 parent ba267bc
Thomas M. Hermann authored
Showing with 10 additions and 5 deletions.
  1. +4 −0 internal-test/example-tests.lisp
  2. +6 −5 lisp-unit.lisp
View
4 internal-test/example-tests.lisp
@@ -57,6 +57,10 @@
(dotimes (i 5)
(assert-equal i (my-sqrt (* i i)) i)))
+(define-test cl-user::my-sqrt
+ (dotimes (i 5)
+ (assert-equal i (my-sqrt (* i i)) i)))
+
;;; Macro
(defmacro my-macro (arg1 arg2)
View
11 lisp-unit.lisp
@@ -265,15 +265,16 @@ assertion.")
(let ((qname (gensym "NAME-")))
(multiple-value-bind (doc tag code) (parse-body body)
`(let* ((,qname (valid-test-name ',name))
- (doc (or ,doc (string ,qname))))
+ (doc (or ,doc (symbol-name ,qname)))
+ (package (symbol-package ,qname)))
(setf
;; Unit test
- (gethash ,qname (package-table *package* t))
+ (gethash ,qname (package-table package t))
(make-instance 'unit-test :doc doc :code ',code))
;; Tags
- (loop for tag in ',tag do
- (pushnew
- ,qname (gethash tag (package-tags *package* t))))
+ (loop
+ for tag in ',tag do
+ (pushnew ,qname (gethash tag (package-tags package t))))
;; Return the name of the test
,qname))))
Please sign in to comment.
Something went wrong with that request. Please try again.