-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Show test.check's generated input for failing tests #1825
Labels
Comments
Definitely. This was always on my radar for |
sebastianpoeplau
added a commit
to sebastianpoeplau/cider-nrepl
that referenced
this issue
Aug 20, 2016
We now capture test input as generated by `test.check` and pass it on to cider_test.el for display.
sebastianpoeplau
added a commit
to sebastianpoeplau/cider
that referenced
this issue
Aug 20, 2016
sebastianpoeplau
added a commit
to sebastianpoeplau/cider
that referenced
this issue
Aug 20, 2016
bbatsov
pushed a commit
to clojure-emacs/cider-nrepl
that referenced
this issue
Aug 20, 2016
We now capture test input as generated by `test.check` and pass it on to cider_test.el for display.
I've created a ticket for |
sebastianpoeplau
added a commit
to sebastianpoeplau/cider-nrepl
that referenced
this issue
Sep 4, 2016
test.check now reports minimal failing inputs (clojure/test.check@73b12bc).
bbatsov
pushed a commit
to clojure-emacs/cider-nrepl
that referenced
this issue
Sep 4, 2016
test.check now reports minimal failing inputs (clojure/test.check@73b12bc).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CIDER nicely displays the expected and actual outcome for tests in the clojure.test framework. However, when the tests are based on test.check the output lacks information about the generated inputs.
For example, consider the following property:
Checking it in CIDER yields this output:
It would be nice to also learn which
x
caused the test to fail. To this end, I would suggest to capture that very piece of information from the test.check results and display it in the result buffer whenever applicable.Technically, the information about the failing input has to be propagated to
cider-nrepl.middleware.test/report
, where it could be stored and passed to the Emacs plugin for display. Unfortunately,clojure.test.check.clojure-test.defspec
doesn't do so yet, throwing away everything except the success status, but the extension should be relatively simple. The utility library test.chuck already demonstrates a way to go: it calls the report function, in our casecider-nrepl.middleware.test/report
, with an event of:type ::shrunk
when it has worked out the smallest failing inputs. As a first step, one might extendcider-nrepl.middleware.test/report
to handle events of that type and have CIDER display the information in the result buffer. Then the same concept could be applied to test.check'sdefspec
. I'll play around with it...The text was updated successfully, but these errors were encountered: