Skip to content

Commit

Permalink
Got rid of a few TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Aug 22, 2023
1 parent c7296ec commit 7c81cab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
9 changes: 3 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 1.8.0

- Check TODOs in code
- Deprecate some APIs?
- Include compileOnly("org.jetbrains:annotations:23.0.0") into API?
Or rather jspecify annotations? To get rid of build warnings.


# 1.8.x

Expand Down Expand Up @@ -45,7 +46,3 @@

- Allow @ForAll on member variables of test container class


# 1.8.0

- Include compileOnly("org.jetbrains:annotations:23.0.0") into API?
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import net.jqwik.api.*;

// TODO: This class is probably not needed at all. Its methods could be pushed down to subclasses.
abstract class UseGeneratorsArbitrary<T> implements Arbitrary<T> {

private final RandomGenerator<T> randomGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ public ActionSequenceArbitrary<?> configure(ActionSequenceArbitrary<?> arbitrary
"%n This usage will throw exception starting with version 1.7.0.",
size, effectiveSize
);
LOG.warning(message);
// TODO: Throw exception as soon as release 1.7.0
// throw new JqwikException(message);
throw new JqwikException(message);
}
return arbitrary.ofSize(effectiveSize);
}
Expand Down
9 changes: 1 addition & 8 deletions testing/src/main/java/net/jqwik/testing/TestingSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,8 @@ public static <T> Map<T, Long> count(RandomGenerator<T> generator, int tries, Ra
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
}

// TODO: Call from TestingSupportFacade
public static <T> Shrinkable<T> generateUntil(RandomGenerator<T> generator, Random random, Function<T, Boolean> condition) {
long maxTries = 1000;
return generator
.stream(random)
.limit(maxTries)
.filter(shrinkable -> condition.apply(shrinkable.value()))
.findFirst()
.orElseThrow(() -> new JqwikException("Failed to generate value that fits condition after " + maxTries + " tries."));
return TestingSupportFacade.implementation.generateUntil(generator, random, condition);
}

@API(status = EXPERIMENTAL, since = "1.6.0")
Expand Down

0 comments on commit 7c81cab

Please sign in to comment.