mirror of
https://gitee.com/johng/gf
synced 2026-07-08 22:40:30 +08:00
添加身份证号尾数验证规则,添加银行卡号验证规则
This commit is contained in:
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user