| 841 | } |
| 842 | |
| 843 | func TestEchoPatch(t *testing.T) { |
| 844 | e := New() |
| 845 | |
| 846 | ri := e.PATCH("/", func(c *Context) error { |
| 847 | return c.String(http.StatusTeapot, "OK") |
| 848 | }) |
| 849 | |
| 850 | assert.Equal(t, http.MethodPatch, ri.Method) |
| 851 | assert.Equal(t, "/", ri.Path) |
| 852 | assert.Equal(t, http.MethodPatch+":/", ri.Name) |
| 853 | assert.Nil(t, ri.Parameters) |
| 854 | |
| 855 | status, body := request(http.MethodPatch, "/", e) |
| 856 | assert.Equal(t, http.StatusTeapot, status) |
| 857 | assert.Equal(t, "OK", body) |
| 858 | } |
| 859 | |
| 860 | func TestEchoPost(t *testing.T) { |
| 861 | e := New() |