You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generex(pattern) initialization is performed on each generation. In other words, Generex parses the pattern and builds regex automata for each generate call which is waste.
Cloning Random is kind of hard. In practice, Generex#prepareRandom does not need the full power of Random, so it might make sense to add a thin interface RandomSource with methods like nextInt(int) and nextFloat().
Then end-users could instantiate Generex just once, and pick random values as needed (providing it with RandomSource instance).
The text was updated successfully, but these errors were encountered:
Currently it is hard to integrate Generex and https://github.com/pholser/junit-quickcheck.
Here's "example" implementation: https://github.com/pholser/junit-quickcheck/blob/61e751ceb55cb767d7ef150959df0244543fcd64/examples/src/test/java/com/pholser/junit/quickcheck/examples/text/Structured.java#L51
There are two problems there:
Generex(pattern)
initialization is performed on each generation. In other words,Generex
parses the pattern and builds regex automata for each generate call which is waste.Cloning
Random
is kind of hard. In practice,Generex#prepareRandom
does not need the full power ofRandom
, so it might make sense to add a thin interfaceRandomSource
with methods likenextInt(int)
andnextFloat()
.Then end-users could instantiate
Generex
just once, and pick random values as needed (providing it withRandomSource
instance).The text was updated successfully, but these errors were encountered: