Skip to content

Commit 27b33f1

Browse files
committed
📝 doc: update some code comment info
1 parent 4491213 commit 27b33f1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

issues_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ func TestIssues_120(t *testing.T) {
860860
}
861861

862862
// https://github.com/gookit/validate/issues/124
863+
// Validate array/slice items #124
863864
func TestIssue_124(t *testing.T) {
864865
m := map[string]any{
865866
"names": []string{"John", "Jane", "abc"},
@@ -1268,7 +1269,7 @@ func TestIssues_192(t *testing.T) {
12681269
Main1 *struct {
12691270
Child11 int `json:"child11" validate:"required"`
12701271
Child12 int `json:"child12" validate:"required"`
1271-
} `json:"main1" validate:"optional"` // optional sometimes
1272+
} `json:"main1" validate:"optional"` // optional - will not validate Main1.* on Main1 is nil
12721273

12731274
Main2 *struct {
12741275
Child21 int `json:"child21" validate:"required"`
@@ -1296,9 +1297,9 @@ func TestIssues_192(t *testing.T) {
12961297
assert.StrContains(t, v.Errors.String(), "main1.child11 is required to not be empty")
12971298
})
12981299

1299-
// set main1 = nil, should not validate Main1.child1
1300+
// set main1 = nil, should not validate Main1.*
13001301
t.Run("set main1 to nil", func(t *testing.T) {
1301-
req.Main1 = nil // TODO 应该不验证child1字段了
1302+
req.Main1 = nil // fields under Main1 will not be validated
13021303
v := validate.Struct(req)
13031304
assert.True(t, v.Validate())
13041305
})

util_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,7 @@ func TestCallByValue_nil_arg(t *testing.T) {
110110
rs := CallByValue(reflect.ValueOf(fn1), nil)
111111
dump.P(rs[0].CanInterface(), rs[0].Interface())
112112
}
113+
114+
func TestFunc_convertArgsType(t *testing.T) {
115+
// TODO add more test case ...
116+
}

0 commit comments

Comments
 (0)