Home / Function/ Test_Route_Match_SameLength() — fiber Function Reference

Test_Route_Match_SameLength() — fiber Function Reference

Architecture documentation for the Test_Route_Match_SameLength() function in router_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  11f210d5_aa02_4ef1_653d_f7157ad43ed8["Test_Route_Match_SameLength()"]
  326d7e00_9e4f_d854_0c78_b9c0c93e5537["router_test.go"]
  11f210d5_aa02_4ef1_653d_f7157ad43ed8 -->|defined in| 326d7e00_9e4f_d854_0c78_b9c0c93e5537
  style 11f210d5_aa02_4ef1_653d_f7157ad43ed8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

router_test.go lines 223–248

func Test_Route_Match_SameLength(t *testing.T) {
	t.Parallel()

	app := New()

	app.Get("/:param", func(c Ctx) error {
		return c.SendString(c.Params("param"))
	})

	resp, err := app.Test(httptest.NewRequest(MethodGet, "/:param", http.NoBody))
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, 200, resp.StatusCode, "Status code")

	body, err := io.ReadAll(resp.Body)
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, ":param", app.toString(body))

	// with param
	resp, err = app.Test(httptest.NewRequest(MethodGet, "/test", http.NoBody))
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, 200, resp.StatusCode, "Status code")

	body, err = io.ReadAll(resp.Body)
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, "test", app.toString(body))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Route_Match_SameLength() do?
Test_Route_Match_SameLength() is a function in the fiber codebase, defined in router_test.go.
Where is Test_Route_Match_SameLength() defined?
Test_Route_Match_SameLength() is defined in router_test.go at line 223.

Analyze Your Own Codebase

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

Try Supermodel Free