添加身份证号尾数验证规则,添加银行卡号验证规则

This commit is contained in:
myvfpx
2019-09-24 10:21:37 +08:00
parent a876b6133d
commit b1835ea4e8
3 changed files with 70 additions and 3 deletions

View File

@ -389,12 +389,24 @@ func Test_IDNumber(t *testing.T) {
err5 := gvalid.Check(val5, rule, nil)
gtest.AssertNE(err1, nil)
gtest.AssertNE(err2, nil)
gtest.Assert(err3, nil)
gtest.Assert(err4, nil)
gtest.AssertNE(err3, nil)
gtest.AssertNE(err4, nil)
gtest.Assert(err5, nil)
})
}
func Test_LuHn(t *testing.T) {
gtest.Case(t, func() {
rule := "luhn"
val1 := "6230514630000424470"
val2 := "6230514630000424473"
err1 := gvalid.Check(val1, rule, nil)
err2 := gvalid.Check(val2, rule, nil)
gtest.AssertNE(err1, nil)
gtest.Assert(err2, nil)
})
}
func Test_QQ(t *testing.T) {
gtest.Case(t, func() {
rule := "qq"