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

Add more known Regex patterns to increase test coverage. #1617

Merged
merged 1 commit into from
Jan 11, 2020

Conversation

eerhardt
Copy link
Member

Adding a few real-world Regex patterns I found.

Copy link
Member

@stephentoub stephentoub left a 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!

@danmoseley
Copy link
Member

[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)]
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

@eerhardt eerhardt Jan 10, 2020

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.

Copy link
Member Author

@eerhardt eerhardt Jan 10, 2020

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. 😉

https://www.whois.com/whois/proseware.com

@stephentoub stephentoub merged commit a1a5e57 into dotnet:master Jan 11, 2020
@eerhardt eerhardt deleted the AddKnownRegexes branch April 21, 2020 14:54
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants