Home / Function/ TestContextRenderUTF8Attachment() — gin Function Reference

TestContextRenderUTF8Attachment() — gin Function Reference

Architecture documentation for the TestContextRenderUTF8Attachment() function in context_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  31024bb1_155d_c204_9af1_69224d61b483["TestContextRenderUTF8Attachment()"]
  ebe0ae48_a62b_a38f_5bac_5bbbd96fc508["context_test.go"]
  31024bb1_155d_c204_9af1_69224d61b483 -->|defined in| ebe0ae48_a62b_a38f_5bac_5bbbd96fc508
  style 31024bb1_155d_c204_9af1_69224d61b483 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

context_test.go lines 1472–1483

func TestContextRenderUTF8Attachment(t *testing.T) {
	w := httptest.NewRecorder()
	c, _ := CreateTestContext(w)
	newFilename := "new🧡_filename.go"

	c.Request, _ = http.NewRequest(http.MethodGet, "/", nil)
	c.FileAttachment("./gin.go", newFilename)

	assert.Equal(t, 200, w.Code)
	assert.Contains(t, w.Body.String(), "func New(opts ...OptionFunc) *Engine {")
	assert.Equal(t, `attachment; filename*=UTF-8''`+url.QueryEscape(newFilename), w.Header().Get("Content-Disposition"))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestContextRenderUTF8Attachment() do?
TestContextRenderUTF8Attachment() is a function in the gin codebase, defined in context_test.go.
Where is TestContextRenderUTF8Attachment() defined?
TestContextRenderUTF8Attachment() is defined in context_test.go at line 1472.

Analyze Your Own Codebase

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

Try Supermodel Free