Smail/server/utils/address/address_test.go
木木的木头 f4689d073c v2.2.0
2023-09-08 02:11:00 +08:00

43 lines
592 B
Go

package address
import "testing"
func TestIsValidEmailAddress(t *testing.T) {
type args struct {
str string
}
tests := []struct {
name string
args args
want bool
}{
{
"",
args{"test@qq.com"},
true,
},
{
"",
args{"1000@qq.com"},
true,
},
{
"",
args{"1000@163.com"},
true,
},
{
"",
args{"1000@1631com"},
false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := IsValidEmailAddress(tt.args.str); got != tt.want {
t.Errorf("IsValidEmailAddress() = %v, want %v", got, tt.want)
}
})
}
}