forked from jqwik-team/jqwik
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified checking for shrunk values. One test still sporadically fa…
…iling.
- Loading branch information
Showing
6 changed files
with
91 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
engine/src/test/java/net/jqwik/engine/ShrinkToChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package net.jqwik.engine; | ||
|
||
import java.util.*; | ||
import java.util.function.*; | ||
|
||
import net.jqwik.api.lifecycle.*; | ||
|
||
import static org.assertj.core.api.Assertions.*; | ||
|
||
public abstract class ShrinkToChecker implements Consumer<PropertyExecutionResult> { | ||
@Override | ||
public void accept(PropertyExecutionResult propertyExecutionResult) { | ||
Optional<List<Object>> falsifiedSample = propertyExecutionResult.getFalsifiedSample(); | ||
assertThat(falsifiedSample).isPresent(); | ||
assertThat(falsifiedSample.get()).containsExactlyElementsOf(shrunkValues()); | ||
|
||
} | ||
|
||
public abstract Iterable<?> shrunkValues(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters