mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:50:55 +00:00
validattion: add test case for email valid
This commit is contained in:
parent
d41f4c0a3a
commit
b34853f8cc
@ -214,6 +214,12 @@ func TestEmail(t *testing.T) {
|
|||||||
if !valid.Email("suchuangji@gmail.com", "email").Ok {
|
if !valid.Email("suchuangji@gmail.com", "email").Ok {
|
||||||
t.Error("\"suchuangji@gmail.com\" is a valid email address should be true")
|
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) {
|
func TestIP(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user