Files
warmbly/internal/app/consumer/auth_check_sweep_test.go
T

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)
}
}
}