Skip to content

Commit

Permalink
Merge pull request #52 from evnu/info-on-running-previous-counterexample
Browse files Browse the repository at this point in the history
Add information on purging counterexamples
  • Loading branch information
alfert authored May 29, 2018
2 parents de34072 + 4692ef8 commit 1406c5d
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit 1406c5d

Please sign in to comment.