I used some non-standard string fuzzers in my test recently and was wondering whether it would be a good idea to publish them as a package. Currently, I have three fuzzers:
nonemptyStringFuzzer
nonblankStringFuzzer (at least one printable, i. e. non-whitespace, character)
whitespaceStringFuzzer
Would there be interest in my publishing of these sorts of fuzzers? What are things I might consider?
I am asking because I’ve read some time ago that generators for the fuzzers in the elm-explorations/test library are not exposed, because of concerns with people messing around with them without really understanding what they are doing. E. g. filtering fuzzers’ results instead of generating correct values. So I wanted to make sure I didn’t get into something that other people have decided against for good reasons. Hope you understand where I’m coming from.
My proposal goes slightly beyond unicode. It’s about more precise control over what type of strings get generated. So that can include unicode.
I imagine that it would be similar to e. g. List.Extra, where it’s not part of the “standard library”, but easily added when you need it. This would allow some experimentation.
I have spent some time building a library that given a regular expression will produce a fuzzer for strings that satisfy the regular expression. However I got sidetracked in the intricacies of the specifics of the JavaScript regex spec and its various modes that I never finished the project.
I’ve linked the repo where I uploaded the code. It’s not yet documented and not currently a priority for me, but feel free to check it out and leave an issue or PR.