| 1007 | } |
| 1008 | |
| 1009 | func TestLiteralColonWithDirectServeHTTP(t *testing.T) { |
| 1010 | SetMode(TestMode) |
| 1011 | router := New() |
| 1012 | |
| 1013 | router.GET(`/test\:action`, func(c *Context) { |
| 1014 | c.JSON(http.StatusOK, H{"path": "literal_colon"}) |
| 1015 | }) |
| 1016 | |
| 1017 | w := httptest.NewRecorder() |
| 1018 | req, _ := http.NewRequest(http.MethodGet, "/test:action", nil) |
| 1019 | router.ServeHTTP(w, req) |
| 1020 | |
| 1021 | assert.Equal(t, http.StatusOK, w.Code) |
| 1022 | assert.Contains(t, w.Body.String(), "literal_colon") |
| 1023 | } |
| 1024 | |
| 1025 | func TestLiteralColonWithHandler(t *testing.T) { |
| 1026 | SetMode(TestMode) |