MCPcopy Create free account
hub / github.com/kataras/iris / TestCompressionAfterRecorder

Function TestCompressionAfterRecorder

_examples/compression/main_test.go:22–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestCompressionAfterRecorder(t *testing.T) {
23 var expectedReply = payload{Username: "Makis"}
24
25 app := iris.New()
26 app.Use(func(ctx iris.Context) {
27 ctx.Record()
28 ctx.Next()
29 })
30 app.Use(iris.Compression)
31
32 app.Get("/", func(ctx iris.Context) {
33 ctx.JSON(expectedReply)
34 })
35
36 e := httptest.New(t, app)
37 testBody(t, e.GET("/"), expectedReply)
38}
39
40func TestCompressionBeforeRecorder(t *testing.T) {
41 var expectedReply = payload{Username: "Makis"}

Callers

nothing calls this directly

Calls 8

NewFunction · 0.92
testBodyFunction · 0.85
NewMethod · 0.80
RecordMethod · 0.80
NextMethod · 0.80
UseMethod · 0.65
GetMethod · 0.65
JSONMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…