Home / Function/ Test_Utils_IsNoCache() — fiber Function Reference

Test_Utils_IsNoCache() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

helpers_test.go lines 771–800

func Test_Utils_IsNoCache(t *testing.T) {
	t.Parallel()
	testCases := []struct {
		string
		bool
	}{
		{string: "public", bool: false},
		{string: "no-cache", bool: true},
		{string: "public, no-cache, max-age=30", bool: true},
		{string: "public,no-cache", bool: true},
		{string: "public,no-cacheX", bool: false},
		{string: "no-cache, public", bool: true},
		{string: "Xno-cache, public", bool: false},
		{string: "max-age=30, no-cache,public", bool: true},
		{string: "NO-CACHE", bool: true},
		{string: "public, NO-CACHE", bool: true},
		// RFC 9111 §5.2.2.4: no-cache with field-name argument
		{string: "no-cache=\"Set-Cookie\"", bool: true},
		{string: "public, no-cache=\"Set-Cookie, Set-Cookie2\"", bool: true},
		{string: "no-cache=Set-Cookie", bool: true},
		// Edge cases with spaces
		{string: "no-cache ,public", bool: true},
		{string: "public, no-cache =field", bool: true},
	}

	for _, c := range testCases {
		ok := isNoCache(c.string)
		require.Equal(t, c.bool, ok, "want %t, got isNoCache(%s)=%t", c.bool, c.string, ok)
	}
}

Domain

Subdomains

Defined In

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free