(t *testing.T)
| 724 | } |
| 725 | |
| 726 | func TestServeMux_HandlePath(t *testing.T) { |
| 727 | mux := runtime.NewServeMux() |
| 728 | testFn := func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) { |
| 729 | } |
| 730 | for _, tt := range defaultRouteMatcherTests { |
| 731 | t.Run(tt.name, func(t *testing.T) { |
| 732 | err := mux.HandlePath(tt.method, tt.path, testFn) |
| 733 | if tt.valid && err != nil { |
| 734 | t.Errorf("The route %v with method %v and path %v invalid, got %v", tt.name, tt.method, tt.path, err) |
| 735 | } |
| 736 | if !tt.valid && err == nil { |
| 737 | t.Errorf("The route %v with method %v and path %v should be invalid", tt.name, tt.method, tt.path) |
| 738 | } |
| 739 | }) |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | var healthCheckTests = []struct { |
| 744 | name string |
nothing calls this directly
no test coverage detected