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

Function mockRegexHandler

path_test.go:556–564  ·  view source on GitHub ↗

mockRegexHandler is a mock regex handler function for testing

(lastPattern *string, compileCalled *bool)

Source from the content-addressed store, hash-verified

554
555// mockRegexHandler is a mock regex handler function for testing
556func mockRegexHandler(lastPattern *string, compileCalled *bool) any {
557 return func(pattern string) regexMatcher {
558 *compileCalled = true
559 *lastPattern = pattern
560 return &mockRegexCompiler{
561 Regexp: regexp.MustCompile(pattern),
562 }
563 }
564}
565
566// Test_RegexHandler_Custom verifies that a custom regex handler can be used
567func Test_RegexHandler_Custom(t *testing.T) {

Callers 2

Test_RegexHandler_CustomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected