@@ -284,7 +284,7 @@ func TestDecode(t *testing.T) {
284284
285285 // test Form decode
286286 form := url.Values {}
287- form .Add ("Posted" , "value " )
287+ form .Add ("Posted" , "values " )
288288
289289 test = new (TestStruct )
290290 r , _ = http .NewRequest (http .MethodPost , "/decode-query?id=13" , strings .NewReader (form .Encode ()))
@@ -293,7 +293,7 @@ func TestDecode(t *testing.T) {
293293 mux .ServeHTTP (w , r )
294294 Equal (t , w .Code , http .StatusOK )
295295 Equal (t , test .ID , 13 )
296- Equal (t , test .Posted , "value " )
296+ Equal (t , test .Posted , "values " )
297297 Equal (t , test .MultiPartPosted , "" )
298298
299299 test = new (TestStruct )
@@ -303,14 +303,14 @@ func TestDecode(t *testing.T) {
303303 mux .ServeHTTP (w , r )
304304 Equal (t , w .Code , http .StatusOK )
305305 Equal (t , test .ID , 0 )
306- Equal (t , test .Posted , "value " )
306+ Equal (t , test .Posted , "values " )
307307 Equal (t , test .MultiPartPosted , "" )
308308
309309 // test MultipartForm
310310 body := & bytes.Buffer {}
311311 writer := multipart .NewWriter (body )
312312
313- err := writer .WriteField ("MultiPartPosted" , "value " )
313+ err := writer .WriteField ("MultiPartPosted" , "values " )
314314 Equal (t , err , nil )
315315
316316 // Don't forget to close the multipart writer.
@@ -326,12 +326,12 @@ func TestDecode(t *testing.T) {
326326 Equal (t , w .Code , http .StatusOK )
327327 Equal (t , test .ID , 12 )
328328 Equal (t , test .Posted , "" )
329- Equal (t , test .MultiPartPosted , "value " )
329+ Equal (t , test .MultiPartPosted , "values " )
330330
331331 body = & bytes.Buffer {}
332332 writer = multipart .NewWriter (body )
333333
334- err = writer .WriteField ("MultiPartPosted" , "value " )
334+ err = writer .WriteField ("MultiPartPosted" , "values " )
335335 Equal (t , err , nil )
336336
337337 // Don't forget to close the multipart writer.
@@ -347,19 +347,19 @@ func TestDecode(t *testing.T) {
347347 Equal (t , w .Code , http .StatusOK )
348348 Equal (t , test .ID , 0 )
349349 Equal (t , test .Posted , "" )
350- Equal (t , test .MultiPartPosted , "value " )
350+ Equal (t , test .MultiPartPosted , "values " )
351351
352352 // test JSON
353- jsonBody := `{"ID":13,"Posted":"value ","MultiPartPosted":"value "}`
353+ jsonBody := `{"ID":13,"Posted":"values ","MultiPartPosted":"values "}`
354354 test = new (TestStruct )
355355 r , _ = http .NewRequest (http .MethodPost , "/decode-query?id=13" , strings .NewReader (jsonBody ))
356356 r .Header .Set (ContentType , ApplicationJSON )
357357 w = httptest .NewRecorder ()
358358 mux .ServeHTTP (w , r )
359359 Equal (t , w .Code , http .StatusOK )
360360 Equal (t , test .ID , 13 )
361- Equal (t , test .Posted , "value " )
362- Equal (t , test .MultiPartPosted , "value " )
361+ Equal (t , test .Posted , "values " )
362+ Equal (t , test .MultiPartPosted , "values " )
363363
364364 var buff bytes.Buffer
365365 gzw := gzip .NewWriter (& buff )
@@ -380,8 +380,8 @@ func TestDecode(t *testing.T) {
380380 mux .ServeHTTP (w , r )
381381 Equal (t , w .Code , http .StatusOK )
382382 Equal (t , test .ID , 14 )
383- Equal (t , test .Posted , "value " )
384- Equal (t , test .MultiPartPosted , "value " )
383+ Equal (t , test .Posted , "values " )
384+ Equal (t , test .MultiPartPosted , "values " )
385385
386386 test = new (TestStruct )
387387 r , _ = http .NewRequest (http .MethodPost , "/decode-noquery?id=14" , strings .NewReader (jsonBody ))
@@ -390,20 +390,20 @@ func TestDecode(t *testing.T) {
390390 mux .ServeHTTP (w , r )
391391 Equal (t , w .Code , http .StatusOK )
392392 Equal (t , test .ID , 13 )
393- Equal (t , test .Posted , "value " )
394- Equal (t , test .MultiPartPosted , "value " )
393+ Equal (t , test .Posted , "values " )
394+ Equal (t , test .MultiPartPosted , "values " )
395395
396396 // test XML
397- xmlBody := `<TestStruct><ID>13</ID><Posted>value </Posted><MultiPartPosted>value </MultiPartPosted></TestStruct>`
397+ xmlBody := `<TestStruct><ID>13</ID><Posted>values </Posted><MultiPartPosted>values </MultiPartPosted></TestStruct>`
398398 test = new (TestStruct )
399399 r , _ = http .NewRequest (http .MethodPost , "/decode-noquery?id=14" , strings .NewReader (xmlBody ))
400400 r .Header .Set (ContentType , ApplicationXML )
401401 w = httptest .NewRecorder ()
402402 mux .ServeHTTP (w , r )
403403 Equal (t , w .Code , http .StatusOK )
404404 Equal (t , test .ID , 13 )
405- Equal (t , test .Posted , "value " )
406- Equal (t , test .MultiPartPosted , "value " )
405+ Equal (t , test .Posted , "values " )
406+ Equal (t , test .MultiPartPosted , "values " )
407407
408408 test = new (TestStruct )
409409 r , _ = http .NewRequest (http .MethodPost , "/decode-query?id=14" , strings .NewReader (xmlBody ))
@@ -412,8 +412,8 @@ func TestDecode(t *testing.T) {
412412 mux .ServeHTTP (w , r )
413413 Equal (t , w .Code , http .StatusOK )
414414 Equal (t , test .ID , 14 )
415- Equal (t , test .Posted , "value " )
416- Equal (t , test .MultiPartPosted , "value " )
415+ Equal (t , test .Posted , "values " )
416+ Equal (t , test .MultiPartPosted , "values " )
417417
418418 buff .Reset ()
419419 gzw = gzip .NewWriter (& buff )
@@ -434,6 +434,6 @@ func TestDecode(t *testing.T) {
434434 mux .ServeHTTP (w , r )
435435 Equal (t , w .Code , http .StatusOK )
436436 Equal (t , test .ID , 13 )
437- Equal (t , test .Posted , "value " )
438- Equal (t , test .MultiPartPosted , "value " )
437+ Equal (t , test .Posted , "values " )
438+ Equal (t , test .MultiPartPosted , "values " )
439439}
0 commit comments