(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func TestClientNoCache(t *testing.T) { |
| 97 | app := iris.New() |
| 98 | var n uint32 |
| 99 | |
| 100 | app.Get("/", cache.Handler(cacheDuration), func(ctx *context.Context) { |
| 101 | atomic.AddUint32(&n, 1) |
| 102 | ctx.Write([]byte(expectedBodyStr)) |
| 103 | }) |
| 104 | |
| 105 | app.Get("/nocache", cache.Handler(cacheDuration), func(ctx *context.Context) { |
| 106 | client.NoCache(ctx) // <---- |
| 107 | atomic.AddUint32(&n, 1) |
| 108 | ctx.Write([]byte(expectedBodyStr)) |
| 109 | }) |
| 110 | |
| 111 | e := httptest.New(t, app) |
| 112 | if err := runTest(e, "/", &n, expectedBodyStr, "/nocache"); err != nil { |
| 113 | t.Fatalf(t.Name()+": %v", err) |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | func TestCache(t *testing.T) { |
| 118 | app := iris.New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…