gfredericks / test.chuck

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

Report the failing is assertions in test.chuck.clojure-test/for-all #47

Open lbradstreet opened 8 years ago

lbradstreet commented 8 years ago

I have had trouble with for-all for a while now, because it doesn't report back the failing assertions:

The point of this PR is to report back which assertions fail. Please let me know if you disagree with implementation and I'll fix it.

Previous behaviour:

{:result false, :seed 1468079929561, :failing-size 0, :num-tests 1, :fail [{n-jobs 1, job-ids [#uuid "4cda91f4-f7db-48ca-a246-852480444eef"], gen-cmds []}], :shrunk {:total-nodes-visited 0, :depth 0, :result false, :smallest [{n-jobs 1, job-ids [#uuid "4cda91f4-f7db-48ca-a246-852480444eef"], gen-cmds []}]}, :test-var "deterministic-abs-test"}
FAIL in (deterministic-abs-test) (clojure_test.cljc:21)
expected: result
  actual: false

New behaviour:

FAIL in (deterministic-abs-test) (deterministic_peer_test.clj:268)
not enough peers
expected: (>= n-peers 4)
  actual: (not (>= 0 4))
{:result false, :seed 1468079929561, :failing-size 0, :num-tests 1, :fail [{n-jobs 1, job-ids [#uuid "4cda91f4-f7db-48ca-a246-852480444eef"], gen-cmds []}], :shrunk {:total-nodes-visited 0, :depth 0, :result false, :smallest [{n-jobs 1, job-ids [#uuid "4cda91f4-f7db-48ca-a246-852480444eef"], gen-cmds []}]}, :test-var "deterministic-abs-test"}

FAIL in (deterministic-abs-test) (clojure_test.cljc:21)
expected: result
  actual: false
lbradstreet commented 8 years ago

Looks like a test is broken (intentionally), but I haven't figured out to reverse it so it's a success yet.

lbradstreet commented 8 years ago

I've hacked around the issue by resetting the report and ensuring the original report failed (since this is the intended result). Unfortunately I haven't figured out how to get rid of the following output (which is expected). Let me know if these changes aren't sufficient.

FAIL in (for-all-test) (clojure_test_test.cljc:30)
expected: (zero? x)
  actual: (not (zero? 1))
gfredericks commented 8 years ago

Does this repeatedly print failures while shrinking? Was that the intention?

lbradstreet commented 8 years ago

Hmm, yes, it does report them while shrinking. Looks like they needs to be be fixed.

On 12 Jul 2016, at 7:36 AM, Gary Fredericks notifications@github.com wrote:

Does this repeatedly print failures while shrinking? Was that the intention?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.