Skip to content

Commit

Permalink
Fix: invalid cases produce inscrutible failures
Browse files Browse the repository at this point in the history
  • Loading branch information
wuest committed Mar 19, 2024
1 parent 3f060ab commit 270470a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/minitest/proptest/property.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def explain
private

def iterate!
while continue_iterate? && @result.nil? && @valid_test_cases <= @max_success / 2
while continue_iterate? && @result.nil? && @valid_test_cases <= @max_success
@valid_test_case = true
@generated = []
@generator = ::Minitest::Proptest::Gen.new(@random)
Expand Down
4 changes: 3 additions & 1 deletion lib/minitest/proptest_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def property(&f)
if prop.status.valid? && !prop.trivial
Proptest.strike_failure(file, classname, methodname)
else
Proptest.record_failure(file, classname, methodname, prop.result.map(&:value)) unless prop.status.exhausted?
unless prop.status.exhausted? || prop.status.invalid?
Proptest.record_failure(file, classname, methodname, prop.result.map(&:value))
end

raise Minitest::Assertion, prop.explain
end
Expand Down

0 comments on commit 270470a

Please sign in to comment.