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

Add information on purging counterexamples #52

Merged
merged 1 commit into from
May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/properties.ex
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ defmodule PropCheck.Properties do
{:ok, counter_example} ->
# Logger.debug "Found counter example #{inspect counter_example}"
result = PropCheck.check(p, counter_example, [:long_result] ++opts)
if result == false, do: counter_example, else: result
if result == false, do: {counter_example, :rerun_failed}, else: result
end
|> handle_check_results(name, should_fail)
end
Expand Down Expand Up @@ -119,6 +119,18 @@ defmodule PropCheck.Properties do
#{inspect counter_example, pretty: true}
""",
expr: nil]
{counter_example, :rerun_failed} when is_list(counter_example) ->
CounterStrike.add_counter_example(name, counter_example)
raise ExUnit.AssertionError, [
message: """
Property #{mfa_to_string name} failed. Counter-Example is:
#{inspect counter_example, pretty: true}
Consider running `mix propcheck.clean` if a bug in a generator was identified
and fixed. PropCheck cannot identify changes to generators. See
https://github.com/alfert/propcheck/issues/30 for more details.
""",
expr: nil]
end
end

Expand Down