mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-05 23:16:50 +08:00
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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user