Home / Function/ TestRunEmptyWithEnv() — gin Function Reference

TestRunEmptyWithEnv() — gin Function Reference

Architecture documentation for the TestRunEmptyWithEnv() function in gin_integration_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  0c01fdcd_a60c_e9cb_8f4b_aeeb2724022c["TestRunEmptyWithEnv()"]
  0cb54875_e9be_d799_8e29_6666cf3d9cd7["testRequest()"]
  0c01fdcd_a60c_e9cb_8f4b_aeeb2724022c -->|calls| 0cb54875_e9be_d799_8e29_6666cf3d9cd7
  style 0c01fdcd_a60c_e9cb_8f4b_aeeb2724022c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_integration_test.go lines 210–224

func TestRunEmptyWithEnv(t *testing.T) {
	os.Setenv("PORT", "3123")
	router := New()
	go func() {
		router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })
		assert.NoError(t, router.Run())
	}()

	// Wait for server to be ready with exponential backoff
	err := waitForServerReady("http://localhost:3123/example", 10)
	require.NoError(t, err, "server should start successfully")

	require.Error(t, router.Run(":3123"))
	testRequest(t, "http://localhost:3123/example")
}

Domain

Subdomains

Frequently Asked Questions

What does TestRunEmptyWithEnv() do?
TestRunEmptyWithEnv() is a function in the gin codebase.
What does TestRunEmptyWithEnv() call?
TestRunEmptyWithEnv() calls 1 function(s): testRequest.

Analyze Your Own Codebase

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

Try Supermodel Free