gfredericks / test.chuck

A utility library for test.check
Eclipse Public License 1.0
215 stars 26 forks source link

cider-test-run-test fails with (wrong-type-argument stringp (dict ... #18

Open sktoiva opened 9 years ago

sktoiva commented 9 years ago

I'm using Emacs 25.0.50.1 and CIDER 0.10.0snapshot.

Given the following example:

(deftest example1
  (checking "this-will-fail" 100
            [n gen/pos-int]
            (is (> 0 n))))

Running test with cider-test-run-test or cider-test-run-tests, the reporting will fail with following error message:

Debugger entered--Lisp error: (wrong-type-argument stringp (dict "fail" (0) "failing-size" 0 "num-tests" ...

I have tested it without the checking macro:

(deftest example2
  (testing "this-will-fail"
    (is (> 0 1))))

This works as intended, so currently I'm assuming the error has something to do with test.chuck and not CIDER itself.

However, invoking the tests with (clojure.test/run-tests) provides the intended output, so I'm a bit loss here where the problem might lie.

gfredericks commented 9 years ago

it looks as if the return value from calling the test function is making its way into cider as some kind of emacs data structure, and that cider is expecting a string for some reason.

gfredericks commented 9 years ago

alternatively, instead of being related to the test return value it might be related to something passed to the clojure.test reporting functions. @lackita any guesses?

gfredericks commented 9 years ago

@sktoiva I'm also curious what happens if you used defspec instead.

sktoiva commented 9 years ago

defspec works as intended, or at least so that the *cider-test-report* buffer contains information about failed tests and the specific information about how it failed is printed to *cider-repl*.