Fix run_n_times for properties expected to fail.

This commit is contained in:
KtorZ 2024-03-04 23:41:37 +01:00
parent 4d432513e0
commit 966a20f691
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 4 additions and 1 deletions

View File

@ -258,7 +258,10 @@ impl PropertyTest {
.sample(&self.fuzzer.program) .sample(&self.fuzzer.program)
.expect("running seeded Prng cannot fail."); .expect("running seeded Prng cannot fail.");
if self.eval(&value).failed(self.can_error) { // NOTE: We do NOT pass self.can_error here, because when searching for
// failing properties, we do want to _keep running_ until we find a
// a failing case. It may not occur on the first run.
if self.eval(&value).failed(false) {
let mut counterexample = Counterexample { let mut counterexample = Counterexample {
value, value,
choices: next_prng.choices(), choices: next_prng.choices(),