(t *testing.T)
| 1983 | } |
| 1984 | |
| 1985 | func TestSkipClean(t *testing.T) { |
| 1986 | func1 := func(w http.ResponseWriter, r *http.Request) {} |
| 1987 | func2 := func(w http.ResponseWriter, r *http.Request) {} |
| 1988 | |
| 1989 | r := NewRouter() |
| 1990 | r.SkipClean(true) |
| 1991 | r.HandleFunc("/api/", func2).Name("func2") |
| 1992 | r.HandleFunc("/", func1).Name("func1") |
| 1993 | |
| 1994 | req, _ := http.NewRequest("GET", "http://localhost//api/?abc=def", nil) |
| 1995 | res := NewRecorder() |
| 1996 | r.ServeHTTP(res, req) |
| 1997 | |
| 1998 | if len(res.HeaderMap["Location"]) != 0 { |
| 1999 | t.Errorf("Shouldn't redirect since skip clean is disabled") |
| 2000 | } |
| 2001 | } |
| 2002 | |
| 2003 | // https://plus.google.com/101022900381697718949/posts/eWy6DjFJ6uW |
| 2004 | func TestSubrouterHeader(t *testing.T) { |
nothing calls this directly
no test coverage detected