(t *testing.T)
| 351 | } |
| 352 | |
| 353 | func TestEventString(t *testing.T) { |
| 354 | scenarios := []testResponseWriteScenario[string]{ |
| 355 | { |
| 356 | name: "no explicit content-type", |
| 357 | status: 234, |
| 358 | headers: nil, |
| 359 | body: "test", |
| 360 | expectedStatus: 234, |
| 361 | expectedHeaders: map[string]string{"content-type": "text/plain; charset=utf-8"}, |
| 362 | expectedBody: "test", |
| 363 | }, |
| 364 | { |
| 365 | name: "with explicit content-type", |
| 366 | status: 234, |
| 367 | headers: map[string]string{"content-type": "text/test"}, |
| 368 | body: "test", |
| 369 | expectedStatus: 234, |
| 370 | expectedHeaders: map[string]string{"content-type": "text/test"}, |
| 371 | expectedBody: "test", |
| 372 | }, |
| 373 | } |
| 374 | |
| 375 | for _, s := range scenarios { |
| 376 | testEventResponseWrite(t, s, func(e *router.Event) error { |
| 377 | return e.String(s.status, s.body) |
| 378 | }) |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | func TestEventHTML(t *testing.T) { |
| 383 | scenarios := []testResponseWriteScenario[string]{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…