(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestFromStd(t *testing.T) { |
| 16 | expected := "ok" |
| 17 | std := func(w http.ResponseWriter, r *http.Request) { |
| 18 | _, err := w.Write([]byte(expected)) |
| 19 | if err != nil { |
| 20 | t.Fatal(err) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | h := handlerconv.FromStd(http.HandlerFunc(std)) |
| 25 | |
| 26 | hFunc := handlerconv.FromStd(std) |
| 27 | |
| 28 | app := iris.New() |
| 29 | app.Get("/handler", h) |
| 30 | app.Get("/func", hFunc) |
| 31 | |
| 32 | e := httptest.New(t, app) |
| 33 | |
| 34 | e.GET("/handler"). |
| 35 | Expect().Status(iris.StatusOK).Body().IsEqual(expected) |
| 36 | |
| 37 | e.GET("/func"). |
| 38 | Expect().Status(iris.StatusOK).Body().IsEqual(expected) |
| 39 | } |
| 40 | |
| 41 | func TestFromStdWithNext(t *testing.T) { |
| 42 | basicauth := "secret" |
nothing calls this directly
no test coverage detected
searching dependent graphs…