problem with lisp-unit
Posted: Wed Jul 11, 2012 2:15 pm
I'm having a problem with lisp-unit. Some asserts don't return the correct value and there is a difference between tests defined in the REPL and tests defined in a lisp buffer.
Starting slime and loading project:
Run tests, defined in testproject.lisp:
Redefine tests in REPL an run them:
The only thing in testproject.lisp is the foobar test, otherwise it's a fresh project created with quicklisp.
How can there be a difference between the tests defined in the REPL and the tests defined in the lisp buffer?
Is there something I'm missing?
Starting slime and loading project:
Code: Select all
; SLIME 2012-04-07
CL-USER> (ql:quickload :testproject)
To load "testproject":
Load 1 ASDF system:
testproject
; Loading "testproject"
(:TESTPROJECT)
CL-USER> (in-package :testproject)
#<PACKAGE "TESTPROJECT">
Code: Select all
TESTPROJECT> (run-tests)
FOOBAR: (FIND '(BAR) '(FOO (BAR) BAZ)) failed:
Expected NIL but saw (BAR)
FOOBAR: (FIND '(BAR) '(FOO (BAR) BAZ) :TEST #'EQ) failed:
Expected NIL but saw (BAR)
FOOBAR: 4 assertions passed, 2 failed.
Code: Select all
TESTPROJECT> (define-test foobar
(assert-false (find '(bar) '(foo (bar) baz)))
(assert-false (find '(bar) (list 'foo (list 'bar) 'baz)))
(assert-false (find '(bar) '(foo (bar) baz) :test #'eq))
(assert-false (find '(bar) (list 'foo (list 'bar) 'baz) :test #'eq))
(assert-true (find '(bar) '(foo (bar) baz) :test #'equal))
(assert-true (find '(bar) (list 'foo (list 'bar) 'baz) :test #'equal))
)
FOOBAR
TESTPROJECT> (run-tests foobar)
FOOBAR: 6 assertions passed, 0 failed.
How can there be a difference between the tests defined in the REPL and the tests defined in the lisp buffer?
Is there something I'm missing?