mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 07:10:55 +00:00
add new test case for china mobile phone
This commit is contained in:
parent
2034d1b101
commit
d02699a189
@ -268,6 +268,18 @@ func TestMobile(t *testing.T) {
|
||||
if !valid.Mobile("+8614700008888", "mobile").Ok {
|
||||
t.Error("\"+8614700008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if !valid.Mobile("17300008888", "mobile").Ok {
|
||||
t.Error("\"17300008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if !valid.Mobile("+8617100008888", "mobile").Ok {
|
||||
t.Error("\"+8617100008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if !valid.Mobile("8617500008888", "mobile").Ok {
|
||||
t.Error("\"8617500008888\" is a valid mobile phone number should be true")
|
||||
}
|
||||
if valid.Mobile("8617400008888", "mobile").Ok {
|
||||
t.Error("\"8617400008888\" is a valid mobile phone number should be false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTel(t *testing.T) {
|
||||
@ -524,7 +536,6 @@ func TestPointer(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func TestCanSkipAlso(t *testing.T) {
|
||||
type User struct {
|
||||
ID int
|
||||
@ -560,4 +571,3 @@ func TestCanSkipAlso(t *testing.T) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user