Skip to content

Commit

Permalink
added negative test cases for email pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
kashifkhan0771 committed Oct 30, 2024
1 parent 5c97255 commit 33cc783
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/common/patterns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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{
Expand Down

0 comments on commit 33cc783

Please sign in to comment.