diff --git a/reader_test.go b/reader_test.go index c121803..735d5bd 100644 --- a/reader_test.go +++ b/reader_test.go @@ -31,16 +31,16 @@ func TestReadForm(t *testing.T) { D []int } values := map[string][]string{ - "x1": []string{"abc", "123"}, - "A1": []string{"a1"}, - "x2": []string{"1", "2"}, - "B.B1": []string{"b1", "b2"}, - "B.B2": []string{"true"}, - "B.B3": []string{"1.23"}, - "c.B1": []string{"fb1", "fb2"}, - "e.B1": []string{"fe1", "fe2"}, - "c": []string{"100"}, - "D": []string{"100", "200", "300"}, + "x1": {"abc", "123"}, + "A1": {"a1"}, + "x2": {"1", "2"}, + "B.B1": {"b1", "b2"}, + "B.B2": {"true"}, + "B.B3": {"1.23"}, + "c.B1": {"fb1", "fb2"}, + "e.B1": {"fe1", "fe2"}, + "c": {"100"}, + "D": {"100", "200", "300"}, } err := ReadFormData(values, &a) assert.Nil(t, err) @@ -100,8 +100,8 @@ func TestTextUnmarshaler(t *testing.T) { NTU string `form:"ntu"` } values := map[string][]string{ - "atu": []string{"ORIGINAL"}, - "ntu": []string{"ORIGINAL"}, + "atu": {"ORIGINAL"}, + "ntu": {"ORIGINAL"}, } err := ReadFormData(values, &a) assert.Nil(t, err) diff --git a/slash/remover_test.go b/slash/remover_test.go index 3dd0447..75d9147 100644 --- a/slash/remover_test.go +++ b/slash/remover_test.go @@ -27,6 +27,7 @@ func TestRemover(t *testing.T) { req, _ = http.NewRequest("GET", "/", nil) c = routing.NewContext(res, req) err = h(c) + assert.Nil(t, err, "return value is nil") assert.Equal(t, http.StatusOK, res.Code) assert.Equal(t, "", res.Header().Get("Location")) @@ -34,6 +35,7 @@ func TestRemover(t *testing.T) { req, _ = http.NewRequest("GET", "/users", nil) c = routing.NewContext(res, req) err = h(c) + assert.Nil(t, err, "return value is nil") assert.Equal(t, http.StatusOK, res.Code) assert.Equal(t, "", res.Header().Get("Location")) @@ -41,6 +43,7 @@ func TestRemover(t *testing.T) { req, _ = http.NewRequest("POST", "/users/", nil) c = routing.NewContext(res, req) err = h(c) + assert.Nil(t, err, "return value is nil") assert.Equal(t, http.StatusTemporaryRedirect, res.Code) assert.Equal(t, "/users", res.Header().Get("Location")) }