(t *testing.T)
| 3149 | } |
| 3150 | |
| 3151 | func TestContextWithFallbackDoneFromRequestContext(t *testing.T) { |
| 3152 | c, _ := CreateTestContext(httptest.NewRecorder()) |
| 3153 | // enable ContextWithFallback feature flag |
| 3154 | c.engine.ContextWithFallback = true |
| 3155 | |
| 3156 | assert.Nil(t, c.Done()) |
| 3157 | |
| 3158 | c2, _ := CreateTestContext(httptest.NewRecorder()) |
| 3159 | // enable ContextWithFallback feature flag |
| 3160 | c2.engine.ContextWithFallback = true |
| 3161 | |
| 3162 | c2.Request, _ = http.NewRequest(http.MethodGet, "/", nil) |
| 3163 | ctx, cancel := context.WithCancel(context.Background()) |
| 3164 | c2.Request = c2.Request.WithContext(ctx) |
| 3165 | cancel() |
| 3166 | assert.NotNil(t, <-c2.Done()) |
| 3167 | } |
| 3168 | |
| 3169 | func TestContextWithFallbackErrFromRequestContext(t *testing.T) { |
| 3170 | c, _ := CreateTestContext(httptest.NewRecorder()) |
nothing calls this directly
no test coverage detected