mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 08:05:45 +00:00
25 lines
540 B
Go
25 lines
540 B
Go
package jobs
|
|
|
|
import "testing"
|
|
|
|
func TestAuthDomainOf(t *testing.T) {
|
|
tests := []struct {
|
|
email string
|
|
want string
|
|
}{
|
|
{"sales@acme.com", "acme.com"},
|
|
{"Sales@Acme.COM", "acme.com"},
|
|
{" user@Example.Org ", "example.org"},
|
|
{"first.last@sub.domain.co", "sub.domain.co"},
|
|
{"plus+tag@acme.com", "acme.com"},
|
|
{"noatsign", ""},
|
|
{"trailingat@", ""},
|
|
{"", ""},
|
|
}
|
|
for _, tt := range tests {
|
|
if got := authDomainOf(tt.email); got != tt.want {
|
|
t.Errorf("authDomainOf(%q) = %q, want %q", tt.email, got, tt.want)
|
|
}
|
|
}
|
|
}
|