MCPcopy
hub / github.com/gofiber/fiber / Test_App_Methods

Function Test_App_Methods

app_test.go:1288–1329  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1286}
1287
1288func Test_App_Methods(t *testing.T) {
1289 t.Parallel()
1290 dummyHandler := testEmptyHandler
1291
1292 app := New()
1293
1294 app.Connect("/:john?/:doe?", dummyHandler)
1295 testStatus200(t, app, "/john/doe", "CONNECT")
1296
1297 app.Put("/:john?/:doe?", dummyHandler)
1298 testStatus200(t, app, "/john/doe", MethodPut)
1299
1300 app.Post("/:john?/:doe?", dummyHandler)
1301 testStatus200(t, app, "/john/doe", MethodPost)
1302
1303 app.Delete("/:john?/:doe?", dummyHandler)
1304 testStatus200(t, app, "/john/doe", MethodDelete)
1305
1306 app.Head("/:john?/:doe?", dummyHandler)
1307 testStatus200(t, app, "/john/doe", MethodHead)
1308
1309 app.Patch("/:john?/:doe?", dummyHandler)
1310 testStatus200(t, app, "/john/doe", MethodPatch)
1311
1312 app.Options("/:john?/:doe?", dummyHandler)
1313 testStatus200(t, app, "/john/doe", MethodOptions)
1314
1315 app.Trace("/:john?/:doe?", dummyHandler)
1316 testStatus200(t, app, "/john/doe", MethodTrace)
1317
1318 app.Query("/:john?/:doe?", dummyHandler)
1319 testStatus200(t, app, "/john/doe", MethodQuery)
1320
1321 app.Get("/:john?/:doe?", dummyHandler)
1322 testStatus200(t, app, "/john/doe", MethodGet)
1323
1324 app.All("/:john?/:doe?", dummyHandler)
1325 testStatus200(t, app, "/john/doe", MethodPost)
1326
1327 app.Use("/:john?/:doe?", dummyHandler)
1328 testStatus200(t, app, "/john/doe", MethodGet)
1329}
1330
1331func Test_App_Route_Naming(t *testing.T) {
1332 t.Parallel()

Callers

nothing calls this directly

Calls 14

testStatus200Function · 0.85
NewFunction · 0.70
ConnectMethod · 0.65
PutMethod · 0.65
PostMethod · 0.65
DeleteMethod · 0.65
HeadMethod · 0.65
PatchMethod · 0.65
OptionsMethod · 0.65
TraceMethod · 0.65
QueryMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected