version 1.0.1 (#8)

* anyutil test

* fix:delete debug

* unit test utils

* unit test

* strUtil unit test

* fix;4, 6, 9, 11 Month determination error

* fix:The last digit of ID number is x, and the weighted sum comparison condition is wrong

* test

* test

* docs

* fix:docs

* idcard test

* test unit

* no message

* docs update

* 单元测试覆盖

---------

Co-authored-by: libin <libinjob@163.com>
Co-authored-by: 李斌 <libin1-hj@huafang.com>
This commit is contained in:
jeffery
2023-03-27 16:52:08 +08:00
committed by GitHub
parent 005437a82b
commit cea73b8e18
14 changed files with 220 additions and 49 deletions

View File

@@ -1,6 +1,7 @@
package validUtil
import (
"fmt"
"testing"
)
@@ -22,6 +23,10 @@ func TestIsTime(t *testing.T) {
}
}
func TestIsDateDemo(t *testing.T) {
fmt.Println(IsDate("2022-04-01"))
}
func TestIsDate(t *testing.T) {
testCases := []struct {
input string
@@ -29,9 +34,11 @@ func TestIsDate(t *testing.T) {
}{
{"2021-01-01", true},
{"2021/01/01", false},
{"2021-13-01", false},
{"2021-20-01", false},
{"2021-02-29", false},
{"2020-02-29", true},
{"2020-02-25", true},
{"2023-04-30", true},
}
for _, testCase := range testCases {