-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added negative test cases for email pattern
- Loading branch information
1 parent
5c97255
commit 33cc783
Showing
1 changed file
with
7 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ const ( | |
|
||
func TestEmailRegexCheck(t *testing.T) { | ||
testEmails := ` | ||
// positive cases | ||
standard email = [email protected] | ||
subdomain email = [email protected] | ||
organization email = [email protected] | ||
|
@@ -30,6 +31,12 @@ func TestEmailRegexCheck(t *testing.T) { | |
dot email = [email protected] | ||
special char email = [email protected] | ||
support email = [email protected] | ||
// negative cases | ||
not an email = abc.123@z | ||
looks like email = test@user <- no domain | ||
email but not = [email protected] <- capital letters not supported for domain | ||
random text = here's some information about local-user@edu user | ||
` | ||
|
||
expectedStr := []string{ | ||
|