1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-14 18:00:54 +00:00

更新16开头手机号的正则测试

This commit is contained in:
Allen 2019-10-22 17:07:22 +08:00
parent 241f10b429
commit fb640f0075

View File

@ -280,6 +280,18 @@ func TestMobile(t *testing.T) {
if valid.Mobile("8617400008888", "mobile").Ok { if valid.Mobile("8617400008888", "mobile").Ok {
t.Error("\"8617400008888\" is a valid mobile phone number should be false") t.Error("\"8617400008888\" is a valid mobile phone number should be false")
} }
if !valid.Mobile("16200008888", "mobile").Ok {
t.Error("\"16200008888\" is a valid mobile phone number should be true")
}
if !valid.Mobile("16500008888", "mobile").Ok {
t.Error("\"16500008888\" is a valid mobile phone number should be true")
}
if !valid.Mobile("16600008888", "mobile").Ok {
t.Error("\"16600008888\" is a valid mobile phone number should be true")
}
if !valid.Mobile("16700008888", "mobile").Ok {
t.Error("\"16700008888\" is a valid mobile phone number should be true")
}
} }
func TestTel(t *testing.T) { func TestTel(t *testing.T) {