Skip to content

Commit

Permalink
Removed deprecated Arbitraries.constant()
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Feb 19, 2021
1 parent 2ad693c commit c1aea1f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 28 deletions.
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
- 1.5.0

- Remove deprecated Arbitrary.just()

- Generate documentation

- Release
Expand Down
14 changes: 0 additions & 14 deletions api/src/main/java/net/jqwik/api/Arbitraries.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,20 +430,6 @@ public static CharacterArbitrary chars() {
return ArbitrariesFacade.implementation.chars();
}

/**
* Create an arbitrary that will always generate the same value.
*
* @param value The value to "generate"
* @param <T> The type of the value
* @return a new arbitrary instance
* @see #just(Object)
* @deprecated Use {@linkplain Arbitraries#just(Object)} instead. To be removed in version 1.5.0.
**/
@API(status = DEPRECATED, since = "1.3.2")
public static <T> Arbitrary<T> constant(T value) {
return just(value);
}

/**
* Create an arbitrary that will always generate the same value.
*
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ title: jqwik Release Notes

- Removed annotation `@Unique` which had been deprecated in 1.4.0

- Removed `Arbitraries.constant(..)` which had been deprecated in 1.3.2

#### Bug Fixes

- Fixed [degraded generation performance](https://github.com/jlink/jqwik/issues/166)
Expand Down
12 changes: 0 additions & 12 deletions engine/src/test/java/net/jqwik/api/ArbitrariesTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,6 @@ void randoms(@ForAll Random random) {
assertAllGenerated(generator, random, (Random value) -> value.nextInt(100) < 100);
}

/**
* Remove this test as soon as Arbitraries.constant(value) is removed
*/
@Example
@SuppressWarnings("deprecation")
void constant(@ForAll Random random) {
Arbitrary<String> constant = Arbitraries.constant("hello");
assertAllGenerated(constant.generator(1000), random, value -> {
assertThat(value).isEqualTo("hello");
});
}

@Example
void just(@ForAll Random random) {
Arbitrary<String> constant = Arbitraries.just("hello");
Expand Down

0 comments on commit c1aea1f

Please sign in to comment.