-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add more known Regex patterns to increase test coverage. #1617
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding these!
[InlineData("a\u0300", true)] // \u0300 is in {Mn} | ||
[InlineData("\u0300b", false)] // \u0300 is in {Mn} | ||
[InlineData("https://foo.com:443/bar/17/groups/0ad1/providers/Network/public/4e-ip?version=16", false)] | ||
[InlineData("[email protected]", false)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I see this came from some ancient BCL blog (at least) but I suggest to replace with a [email protected] address that definitely doesn't belong to anyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this came from some ancient BCL blog
It's actually in the docs:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format#compile-the-code
I just put all of the docs samples into our tests, basically verbatim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I just copied it from the above test.
I can anonymize all the emails (ex. [email protected]
) in this file, if you two think it is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny enough, proseware.com
redirects me to https://www.microsoft.com/en-us/
. So I think it is safe. 😉
Adding a few real-world Regex patterns I found.