MCPcopy
hub / github.com/gin-gonic/gin / TestWithHttptestWithAutoSelectedPort

Function TestWithHttptestWithAutoSelectedPort

gin_integration_test.go:382–390  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

380}
381
382func TestWithHttptestWithAutoSelectedPort(t *testing.T) {
383 router := New()
384 router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })
385
386 ts := httptest.NewServer(router)
387 defer ts.Close()
388
389 testRequest(t, ts.URL+"/example")
390}
391
392func TestConcurrentHandleContext(t *testing.T) {
393 router := New()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
testRequestFunction · 0.85
CloseMethod · 0.80
GETMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected