Files
validate/email_test.go
T

28 lines
448 B
Go
Raw Normal View History

2023-10-06 11:58:24 +01:00
package validate
import "testing"
func TestInvalidEmail(t *testing.T) {
valid := []string{
"testexample.com",
}
for _, email := range valid {
if err := Email(email); err == nil {
t.Errorf("%s is not a valid email", email)
}
}
}
func TestValidEmail(t *testing.T) {
valid := []string{
"test@example.com",
}
for _, email := range valid {
if err := Email(email); err != nil {
t.Errorf("%s is a valid email", email)
}
}
}