(t *testing.T)
| 343 | } |
| 344 | |
| 345 | func TestRenderTOML(t *testing.T) { |
| 346 | w := httptest.NewRecorder() |
| 347 | data := map[string]any{ |
| 348 | "foo": "bar", |
| 349 | "html": "<b>", |
| 350 | } |
| 351 | (TOML{data}).WriteContentType(w) |
| 352 | assert.Equal(t, "application/toml; charset=utf-8", w.Header().Get("Content-Type")) |
| 353 | |
| 354 | err := (TOML{data}).Render(w) |
| 355 | require.NoError(t, err) |
| 356 | assert.Equal(t, "foo = 'bar'\nhtml = '<b>'\n", w.Body.String()) |
| 357 | assert.Equal(t, "application/toml; charset=utf-8", w.Header().Get("Content-Type")) |
| 358 | } |
| 359 | |
| 360 | func TestRenderTOMLFail(t *testing.T) { |
| 361 | w := httptest.NewRecorder() |
nothing calls this directly
no test coverage detected