mockRegexHandler is a mock regex handler function for testing
(lastPattern *string, compileCalled *bool)
| 554 | |
| 555 | // mockRegexHandler is a mock regex handler function for testing |
| 556 | func 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 |
| 567 | func Test_RegexHandler_Custom(t *testing.T) { |
no outgoing calls
no test coverage detected