- Sponsor
-
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
Bug: Arbitraries.strings().uniqueChars() will sometimes shrink to values with duplicate chars #541
Comments
@mattiacolucci Without your implementation of |
The code of the class is the following:
It's basically a class just to generate different types of data: an initilString, a random int and a map of integers and random strings as keys |
@mattiacolucci The problem you are observing is not a generation problem but a shrinking bug. Thanks for catching and reporting it! What I noticed, though, is that this line: finalstring=finalstring.concat(initialString.substring(currIndex,currIndex+step)+key+keyReverse); will sometimes fail with a I suggest that I will work on the shrinking bug - and you on the failing tests logic ;-) |
Fixed in c779a9d |
Released in 1.8.3-SNAPSHOT @mattiacolucci If you want you can try your example with the snapshot release |
Hi, I am using a Provide metod to generate some data like a random string withCharsRange and with no duplicates (using uniqueChars). The problem is that if I put an always true assert in the thest method (like an assertTrue(true)) the data generated is correct and the string "iniial String" doesn't present any duplicate char. But If I use the assertEquals(expected,actual) that I will use to test my method, jqwik generate a string that presents duplicates. In details, going on with the number of the test genrated, the string will contain more chars duplicated, expecially the first char of the range specified into the Arbitrary withCharsRange.
Here is the code:
The output with the assert(expected,actual) is the following:
and so on....
The text was updated successfully, but these errors were encountered: