-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #8 Specify edge case for Try, Validation and Future as failures
- Loading branch information
Befrish
committed
Oct 21, 2020
1 parent
b63eec3
commit 7690526
Showing
5 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/de/befrish/jqwik/vavr/SingletonShrinkable.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,32 @@ | ||
package de.befrish.jqwik.vavr; | ||
|
||
import net.jqwik.api.Shrinkable; | ||
import net.jqwik.api.ShrinkingDistance; | ||
import net.jqwik.engine.properties.shrinking.AbstractValueShrinkable; | ||
|
||
import java.util.stream.Stream; | ||
|
||
/** | ||
* @author Benno Müller | ||
*/ | ||
public class SingletonShrinkable<T> extends AbstractValueShrinkable<T> { | ||
|
||
private SingletonShrinkable(final T value) { | ||
super(value); | ||
} | ||
|
||
public static <T> SingletonShrinkable<T> of(final T value) { | ||
return new SingletonShrinkable<>(value); | ||
} | ||
|
||
@Override | ||
public Stream<Shrinkable<T>> shrink() { | ||
return Stream.of(new SingletonShrinkable(value())); | ||
} | ||
|
||
@Override | ||
public ShrinkingDistance distance() { | ||
return ShrinkingDistance.of(Long.MIN_VALUE); | ||
} | ||
|
||
} |
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
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