Skip to content

Commit 29fb331

Browse files
test
1 parent 912bc9f commit 29fb331

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bindform_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ func TestMarshalForm(t *testing.T) {
133133
StructSlice []testSubStruct `json:"struct_slice,omitempty"`
134134
OptInt *int `json:"opt_int,omitempty"`
135135
OptBool *bool `json:"opt_bool,omitempty"`
136+
OptBoolNullable *bool `json:"opt_bool_nullable"`
136137
OptString *string `json:"opt_string,omitempty"`
137138
OptStruct *testSubStruct `json:"opt_struct,omitempty"`
138139
OptStructSlice *[]testSubStruct `json:"opt_struct_slice,omitempty"`
@@ -151,6 +152,7 @@ func TestMarshalForm(t *testing.T) {
151152
},
152153
"opt_int=456": {OptInt: func(v int) *int { return &v }(456)},
153154
"opt_bool=true": {OptBool: func(v bool) *bool { return &v }(true)},
155+
"": {OptBoolNullable: nil},
154156
"opt_string=def": {OptString: func(v string) *string { return &v }("def")},
155157
"opt_struct[int]=456&opt_struct[string]=def": {OptStruct: &testSubStruct{Int: 456, String: "def"}},
156158
"opt_struct_slice[0][int]=123&opt_struct_slice[0][string]=abc&opt_struct_slice[1][int]=456&opt_struct_slice[1][string]=def": {

0 commit comments

Comments
 (0)