-
Notifications
You must be signed in to change notification settings - Fork 30
Generated strings are too short #81
Copy link
Copy link
Open
Description
When calling rapid.String(), I expected the generated strings to vary in length from 0 to a large number, possibly math.MaxInt, if I interpret this line correctly:
Line 206 in 7adc026
| maxLen = math.MaxInt |
However, in my experience, the length is very limited, apparently rarely more than 100 characters. Take this test:
func Test_RapidGeneratesOnlySmallStrings(t *testing.T) {
maxLength := 0
rapid.Check(t, func(t *rapid.T) {
str := rapid.String().Draw(t, "str")
maxLength = max(len(str), maxLength)
})
fmt.Println("maxLength:", maxLength)
}
I could never get more than "maxLength:102". Here is how I ran the test:
% go test . -run Test_RapidGeneratesOnlySmallStrings -v -rapid.checks=10_000 -rapid.seed=1
For good measure, I tried changing the seed, but it didn't make much difference.
Am I missing something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels