Shinmera / parachute

An extensible and cross-compatible testing framework.
https://shinmera.github.io/parachute
zlib License
97 stars 9 forks source link

Failure reporting and alists #42

Closed tliikala closed 2 years ago

tliikala commented 2 years ago

I have loaded Parachute from Quicklisp.

Let's say that I have something like this.

(defun multi-alist (alist multiply) (mapcar #'(lambda (x) (cons (car x) (* multiply (cdr x)))) alist))

(define-test alist-test (let ((input '((A . 3) (B . 4))) (expected '((A . 6) (B . 8)))) (is equal expected (multi-alist input 2))))

Then, (test 'alist-test) passes ok.

But, if I do a change and the test fails, then there's an error that happens in the reporting.

(define-test alist-test (let ((input '((A . 3) (B . 4))) (expected '((A . 6) (B . 8)))) (is equal expected (multi-alist input 5))))

It is: "Error: Cannot take CAR of 15."

The error happens in the function print-oneline. There seems to be a problem if alists are involded. The (loop for (car . cdr) on thing part seems to be problematic. Other kind of lists like plists seem to work fine but alists seem to cause an error.

Shinmera commented 2 years ago

I don't get such an error on latest. Are you sure you're up to date?

tliikala commented 2 years ago

Thank you for the reply. I was using LispWorks 7.1.2 when I got the error.

Now I tested it using LispWorks 8.0.1 and it works. 👍