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

This commit is contained in:
Allen 2019-10-22 17:07:22 +08:00
parent 241f10b429
commit fb640f0075
1 changed files with 12 additions and 0 deletions

View File

@ -280,6 +280,18 @@ func TestMobile(t *testing.T) {
if valid.Mobile("8617400008888", "mobile").Ok {
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) {