Home / Function/ Test_UnescapeHeaderValue() — fiber Function Reference

Test_UnescapeHeaderValue() — fiber Function Reference

Architecture documentation for the Test_UnescapeHeaderValue() function in helpers_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  35e955f7_5cb1_737a_4498_d5f8222c604e["Test_UnescapeHeaderValue()"]
  c82e3595_b1b8_f596_c097_f26fa40159d1["helpers_test.go"]
  35e955f7_5cb1_737a_4498_d5f8222c604e -->|defined in| c82e3595_b1b8_f596_c097_f26fa40159d1
  style 35e955f7_5cb1_737a_4498_d5f8222c604e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

helpers_test.go lines 1532–1553

func Test_UnescapeHeaderValue(t *testing.T) {
	t.Parallel()
	cases := []struct {
		in  string
		out []byte
		ok  bool
	}{
		{in: "abc", out: []byte("abc"), ok: true},
		{in: "a\\\"b", out: []byte("a\"b"), ok: true},
		{in: "c\\\\d", out: []byte("c\\d"), ok: true},
		{in: "bad\\", ok: false},
	}
	for _, tc := range cases {
		out, err := unescapeHeaderValue([]byte(tc.in))
		if tc.ok {
			require.NoError(t, err, tc.in)
			require.Equal(t, tc.out, out, tc.in)
		} else {
			require.Error(t, err, tc.in)
		}
	}
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_UnescapeHeaderValue() do?
Test_UnescapeHeaderValue() is a function in the fiber codebase, defined in helpers_test.go.
Where is Test_UnescapeHeaderValue() defined?
Test_UnescapeHeaderValue() is defined in helpers_test.go at line 1532.

Analyze Your Own Codebase

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

Try Supermodel Free