go test -run Test_App_Stack
(t *testing.T)
| 2621 | |
| 2622 | // go test -run Test_App_Stack |
| 2623 | func Test_App_Stack(t *testing.T) { |
| 2624 | t.Parallel() |
| 2625 | app := New() |
| 2626 | |
| 2627 | app.Use("/path0", testEmptyHandler) |
| 2628 | app.Get("/path1", testEmptyHandler) |
| 2629 | app.Get("/path2", testEmptyHandler) |
| 2630 | app.Post("/path3", testEmptyHandler) |
| 2631 | app.Query("/path4", testEmptyHandler) |
| 2632 | |
| 2633 | app.startupProcess() |
| 2634 | |
| 2635 | stack := app.Stack() |
| 2636 | methodList := app.config.RequestMethods |
| 2637 | require.Len(t, methodList, len(stack)) |
| 2638 | require.Len(t, stack[app.methodInt(MethodGet)], 3) |
| 2639 | require.Len(t, stack[app.methodInt(MethodHead)], 3) |
| 2640 | require.Len(t, stack[app.methodInt(MethodPost)], 2) |
| 2641 | require.Len(t, stack[app.methodInt(MethodPut)], 1) |
| 2642 | require.Len(t, stack[app.methodInt(MethodPatch)], 1) |
| 2643 | require.Len(t, stack[app.methodInt(MethodDelete)], 1) |
| 2644 | require.Len(t, stack[app.methodInt(MethodConnect)], 1) |
| 2645 | require.Len(t, stack[app.methodInt(MethodOptions)], 1) |
| 2646 | require.Len(t, stack[app.methodInt(MethodTrace)], 1) |
| 2647 | require.Len(t, stack[app.methodInt(MethodQuery)], 2) |
| 2648 | } |
| 2649 | |
| 2650 | // go test -run Test_App_HandlersCount |
| 2651 | func Test_App_HandlersCount(t *testing.T) { |