-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from d--j/socketmap
Socketmap
- Loading branch information
Showing
14 changed files
with
369 additions
and
131 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
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
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
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 |
---|---|---|
|
@@ -80,3 +80,27 @@ func TestDomain_Unicode(t *testing.T) { | |
}) | ||
} | ||
} | ||
|
||
func Test_emailWithoutExtension(t *testing.T) { | ||
type args struct { | ||
local string | ||
asciiDomain string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want string | ||
}{ | ||
{"empty", args{"", ""}, "@"}, | ||
{"without", args{"local", "example.com"}, "[email protected]"}, | ||
{"with", args{"local+hi", "example.com"}, "[email protected]"}, | ||
{"double", args{"local+hi+ho", "example.com"}, "[email protected]"}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := emailWithoutExtension(tt.args.local, tt.args.asciiDomain); got != tt.want { | ||
t.Errorf("emailWithoutExtension() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
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
Oops, something went wrong.