1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:40:49 +00:00

validattion: add test case for email valid

This commit is contained in:
miraclesu 2017-03-12 19:30:23 +08:00
parent d41f4c0a3a
commit b34853f8cc

View File

@ -214,6 +214,12 @@ func TestEmail(t *testing.T) {
if !valid.Email("suchuangji@gmail.com", "email").Ok {
t.Error("\"suchuangji@gmail.com\" is a valid email address should be true")
}
if valid.Email("@suchuangji@gmail.com", "email").Ok {
t.Error("\"@suchuangji@gmail.com\" is a valid email address should be false")
}
if valid.Email("@suchuangji@gmail.com", "email").Ok {
t.Error("\"suchuangji@gmail.com ok\" is a valid email address should be false")
}
}
func TestIP(t *testing.T) {