Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASSERT-TRUE is broken. #41

Open
heegaiximephoomeeghahyaiseekh opened this issue Feb 16, 2017 · 1 comment
Open

ASSERT-TRUE is broken. #41

heegaiximephoomeeghahyaiseekh opened this issue Feb 16, 2017 · 1 comment

Comments

@heegaiximephoomeeghahyaiseekh
Copy link

heegaiximephoomeeghahyaiseekh commented Feb 16, 2017

(define-test check-hex-string
   (let ((hex-string "ABC123"))
      (assert-true
         (loop for ch across hex-string
             always  (member ch (coerce "0123456789ABCDEF" 'list))))))

Results in a compile error on the undefined variables FOR, CH, ACROSS, and ALWAYS.

Replacing this with an assert-eq, where one of the two values is t, solves the problem. Perhaps
the definition of assert-true should simply be something like:

 (defmacro assert-true (expr)
     `(assert-eq (and ,expr t) t))
@liamh
Copy link

liamh commented Oct 14, 2017

Thanks for posting this. I had a similar problem if I had a LET in my test, and not in the others. In my case, the LET was inside the assert-true form. I would get ERROR: illegal function call on the forms defined in the let.

I was able to work around the problem by using assert-equal and give the expected non-NIL result. I don't agree with your suggested macro definition, as assert-true says that the result is non-NIL, not that it's T.

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

No branches or pull requests

2 participants