@@ -355,7 +355,7 @@ func TestBindQueryParameter(t *testing.T) {
355
355
var optionalNonPointerText = ""
356
356
err = BindQueryParameter ("form" , true , false , "notfound" , queryParams , & optionalNonPointerText )
357
357
require .NoError (t , err )
358
- assert .Zero (t , "" )
358
+ assert .Zero (t , optionalNonPointerText )
359
359
360
360
err = BindQueryParameter ("form" , true , false , "text" , queryParams , & optionalNonPointerText )
361
361
require .NoError (t , err )
@@ -367,6 +367,15 @@ func TestBindQueryParameter(t *testing.T) {
367
367
err = BindQueryParameter ("form" , true , true , "notfound" , queryParams , & optionalNumber )
368
368
assert .Error (t , err )
369
369
370
+ var optionalPointerText * string
371
+ err = BindQueryParameter ("form" , true , false , "notfound" , queryParams , & optionalPointerText )
372
+ require .NoError (t , err )
373
+ assert .Zero (t , optionalPointerText )
374
+
375
+ err = BindQueryParameter ("form" , true , false , "text" , queryParams , & optionalPointerText )
376
+ require .NoError (t , err )
377
+ require .NotNil (t , optionalPointerText )
378
+ assert .Equal (t , "loremipsum" , * optionalPointerText )
370
379
})
371
380
}
372
381
0 commit comments