keyongtech


  keyongtech > lisp > 10/2007

 #1  
10-26-07, 07:41 AM
Antony Sequeira
Hi

I am trying to decide on what to use for unit testing.
So, I was trying the FievAM package from
http://common-lisp.net/project/bese/FiveAM.html

I created the following (actually I ran into this issue and the
following is a demo of the issue)

The test macro seems not to do the right thing.
FOO20 []:
Unexpected Error: #<SIMPLE-TYPE-ERROR {1004A6F491}>
Argument X is not a NUMBER: NIL..

Am I doing something wrong or is this a limitation.

I haven't done much CL so don't really know what to call this issue.

Code follows :fiveam-learn
(:use :common-lisp :basic-stats
:it.bese.FiveAM))

(in-package :fiveam-learn)


(def-suite fiveam-learn-suite )

(in-suite fiveam-learn-suite )

(defvar *foo* nil)

(test emptyfoo
(is (null *foo*)))

(let ((*foo* 20))
(format t "foo is ~s ~%" *foo*)
(defun bar ()
(format t "foo is ~s ~%" *foo*))
(test foo20
(is (= *foo* 20)))) ; this fails to get 'proper' value for *foo*

(bar)
(run! 'fiveam-learn-suite)


Thanks,
-Antony
 #2  
10-26-07, 11:27 AM
Josip Gracin
Antony Sequeira wrote:
> (let ((*foo* 20))
> (format t "foo is ~s ~%" *foo*)
> (defun bar ()
> (format t "foo is ~s ~%" *foo*))
> (test foo20
> (is (= *foo* 20)))) ; this fails to get 'proper' value for *foo*


Making the call to TEST a top-level form, i.e.

(test foo20
(let ((*foo* 20))
(flet ((bar () ...))
(is (eql *foo* 20)))))
Similar Threads
Is it possible to dynamically extend Test::Unit test cases?

Hello list, I've got some "normal" test cases that look like this class Testcases < Test::Unit::TestCase def setup ... end

Why does running a Test::unit test in irb work so weirdly?

Why can't I run a Test::Unit::TestCase from IRB and have it run before I quit? I have found this problem mentioned by others. For an example, see this tutorial about...

Can't get Unit Test to work with some projects

I'm having trouble creating unit tests for some of the projects in my solution. The unit test doesn't seem to recognize that there are classes and methods in some of the...

Unit test MCMS using VS 2005 and Test Project

Hi all, I was wondering if anyone has implemented any unit testing for their Microsoft Content Management (MCMS) applications? If they have do they have any examples of how...

Test::Unit -- multiple errors in test method ???

Hi ! I have been writing some unit tests with Test::Unit. I've noted that when an assertion fails in a test method, the remaining assertions in the same test method aren't...


All times are GMT. The time now is 09:46 PM. | Privacy Policy