Skip to content
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

Normalization can make a mismatch around regex #30

Open
m1kit opened this issue Aug 15, 2021 · 1 comment
Open

Normalization can make a mismatch around regex #30

m1kit opened this issue Aug 15, 2021 · 1 comment

Comments

@m1kit
Copy link
Owner

m1kit commented Aug 15, 2021

I found a very minor corner case in dynamically generated test cases.

Given a regex .{,20} the random test generator generates a string like this:

B_V$n<?2.M0$@1CjSjyt

I expected this string to match the regular expression.

However, the normalizer normalizes the string like this:

b-`v$n<?2.`m0$@1cjsjyt

Note that there are two spaces inserted after _ and ..

This normalization process itself is expected behavior, but this normalized string does not match to the regex. This is because the length of the string is increased to 22 by two spaces.

Hi @goneall @anshuldutt21, please let me know your feelings on this issue.
I think this is a very minor issue and we may ignore. Instead, we can change a way to generate random tests (like treat a pattern . as [a-zA-Z0-9]).

@goneall
Copy link

goneall commented Aug 15, 2021

I think this is a very minor issue and we may ignore. Instead, we can change a way to generate random tests (like treat a pattern . as [a-zA-Z0-9]).

Agree it is a very minor issue - it would be better to resolve so that we get a cleaner set of test results. Changing the pattern for the generated tests seems quite reasonable as it would test the most likely scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants