Home / Function/ TestRenderTOML() — gin Function Reference

TestRenderTOML() — gin Function Reference

Architecture documentation for the TestRenderTOML() function in render_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  4c632954_51e1_978e_87fe_f72d3b41c6c9["TestRenderTOML()"]
  067a4839_481a_7bd8_fc59_5c8c3313879c["render_test.go"]
  4c632954_51e1_978e_87fe_f72d3b41c6c9 -->|defined in| 067a4839_481a_7bd8_fc59_5c8c3313879c
  style 4c632954_51e1_978e_87fe_f72d3b41c6c9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

render/render_test.go lines 313–326

func TestRenderTOML(t *testing.T) {
	w := httptest.NewRecorder()
	data := map[string]any{
		"foo":  "bar",
		"html": "<b>",
	}
	(TOML{data}).WriteContentType(w)
	assert.Equal(t, "application/toml; charset=utf-8", w.Header().Get("Content-Type"))

	err := (TOML{data}).Render(w)
	require.NoError(t, err)
	assert.Equal(t, "foo = 'bar'\nhtml = '<b>'\n", w.Body.String())
	assert.Equal(t, "application/toml; charset=utf-8", w.Header().Get("Content-Type"))
}

Subdomains

Frequently Asked Questions

What does TestRenderTOML() do?
TestRenderTOML() is a function in the gin codebase, defined in render/render_test.go.
Where is TestRenderTOML() defined?
TestRenderTOML() is defined in render/render_test.go at line 313.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free