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

Function TestRunQUIC

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

Source from the content-addressed store, hash-verified

280}
281
282func TestRunQUIC(t *testing.T) {
283 router := New()
284 go func() {
285 router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })
286
287 assert.NoError(t, router.RunQUIC(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
288 }()
289
290 // have to wait for the goroutine to start and run the server
291 // otherwise the main thread will complete
292 time.Sleep(5 * time.Millisecond)
293
294 require.Error(t, router.RunQUIC(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
295 testRequest(t, "https://localhost:8443/example")
296}
297
298func TestFileDescriptor(t *testing.T) {
299 router := New()

Callers

nothing calls this directly

Calls 6

NewFunction · 0.85
testRequestFunction · 0.85
RunQUICMethod · 0.80
GETMethod · 0.65
StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected