Comments (4)
Sorry, this is probably a duplicate of #41, feel free to close if you think so.
from jqwik.
I think what you want can be done using
arbitrary.generator(1000).generate(new Random()) .value()
if you want a single value.
Use
arbitrary.generator(1000).stream(new Random()) .map(Shrinkable::value)
if you need a stream of value.
Would that work for your purposes?
from jqwik.
oh yeah, that'll do it i think, thank you!
from jqwik.
Note, Arbitrary<T>
type now have experimental methods Arbitrary<T>.sample()
and Arbitrary<T>.samplesStream()
for convenient use. See #76 (comment) for some discussion and its introduction.
PS: Do not be mistaken by Arbitraries.samples(...)
method, which is similar by syntax, but does have way different purpose (it creates Arbitrary instance with passed possible values). Example usage in "oneliner":
Arbitraries.samples("asdf", "qwertz", "qwerty")
.sampleStream()
.limit(42)
.forEach(x -> System.out.println(x));
from jqwik.
Related Issues (20)
- Domains inject parameterized values incorrectly HOT 25
- Method to specify the order of execution for tests HOT 5
- Programmatic use of jqwik without JUnit HOT 3
- Repeatead chars not working as expected HOT 6
- Every X years in @YearRange HOT 1
- Allow parallel test runs with SBT HOT 15
- Infinite action chains biased towards small sizes HOT 5
- 1.8.0 contracts regression HOT 16
- IllegalArgumentException: "At least one shrinkable is required" during shrinking hides cause of test failure HOT 4
- Consider supporting @UseType for sealed interfaces HOT 8
- Shrinking of large arrays uses a very large amount of memory HOT 11
- StackOverflowError when shrinking large arrays HOT 14
- question: any way to imperatively summon a pre-configured arbitrary? HOT 15
- Make nested groups work for JDK >= 18 HOT 31
- Combinators.combine.as nullability of arguments HOT 4
- Can't figure out how to create an Arbitrary I want HOT 10
- Bug: Arbitraries.strings().uniqueChars() will sometimes shrink to values with duplicate chars HOT 5
- Bug: Uniform Distribution of Integers does not work if range is >= Integer.MAX_VALUE HOT 2
- Kotlin K2 Support HOT 23
- Time Module: Support generating java.sql.Timestamp
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jqwik.