Closed kwongtailau closed 4 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
@googlebot I signed it!
Thank you for the PR, it's an interesting idea.
My first thought is that I'm worried about making a promise like this in the API, it seems overly specific. People who want to test a specific unicode range could make a custom fuzzing function? Is that too hard?
If this behavior is so universally useful that it's good to expose it as a top level knob, I think rather than expose constants that refer to ranges, I'd let users supply their own list of ranges. (And maybe expose a few useful public range lists.) That's more future proof.
Unicode is really complicated, and I'm worried that naming a few simple ranges doesn't accurately describe what is going on.
@lavalamp Thanks for your reply. I seriously thought about the situation that you are worried about.
Finally I changes the function WithStringGenMode
to WithCharRange
.
This function provides the logic for the developers to input the Unicode encoding range, so that they can generate different encoding string. If they do not want to specific the string, they can generate fuzz string as usual.
Looking forward to receiving your reply again or comment in code.
Thank you for giving me a lot of suggestions patiently, which is very helpful to me.
As a student who has just graduated from school for just one year. I learned a lot in this PR. ^-^
LGTM, thanks!
You can use
f.WithStringGenMode(mode)
to set generation mode to generate different character, like ASCII, MultiByte, CommonCJK, Chinese, Japanese, Number, Lower-Case, Upper-Case , default is random mode(each rune will be one of above character).