-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeatead chars not working as expected #506
Comments
@esfomeado Thanks for raising that issue. I’ll have to think about if changing the behaviour or documentation of To solve your problem short-term, you can use withoutEdgeCases() on the strings arbitrary: Arbitraries.strings().alpha()
.ofMinLength(5).ofMaxLength(25)
.repeatChars(0.0)
.withoutEdgeCases(); This will prevent „AAAAA“ to be generated on purpose. Duplicate chars will still occur by chance though. If you definitely want no duplicates, you’d currently have to take a detour through something like: Arbitraries.chars().alpha().list()
.ofMinSize(5).ofMaxSize(25)
.uniqueElements()
.map(chars -> chars.stream().map(String::valueOf).collect(Collectors.joining())); |
I decided to introduce an experimental new API method: The open question is if @esfomeado What do you think? |
Thanks for the quick response. @jlink Personally I would expect to have the same behaviour was |
The |
In addition, there's now an annotation |
New features available in 1.8.0-SNAPSHOT |
Testing Problem
I had an issue where jqwik is generating duplicated values frequently which, for my example should almost never occur.
I have noticed that these duplicated values are always the same character e,g,
AAAAAA
so I decided to set therepeatedChars
to 0 but this type of values are still generated. I have tried the other values but seems that there is no impact on the ammount of time a repeated char is used.The text was updated successfully, but these errors were encountered: