MCPcopy Create free account
hub / github.com/dlclark/regexp2 / assertEquivalentStringMatchStartingAt

Function assertEquivalentStringMatchStartingAt

regexp_optimization_test.go:528–534  ·  view source on GitHub ↗
(t *testing.T, optimized, unoptimized *Regexp, input string, startAt int)

Source from the content-addressed store, hash-verified

526}
527
528func assertEquivalentStringMatchStartingAt(t *testing.T, optimized, unoptimized *Regexp, input string, startAt int) {
529 t.Helper()
530
531 gotMatch, gotErr := optimized.FindStringMatchStartingAt(input, startAt)
532 wantMatch, wantErr := unoptimized.FindStringMatchStartingAt(input, startAt)
533 assertSameMatchResult(t, "FindStringMatchStartingAt", input, gotMatch, gotErr, wantMatch, wantErr)
534}
535
536func assertSameMatchResult(t *testing.T, api, input string, got *Match, gotErr error, want *Match, wantErr error) {
537 t.Helper()

Calls 2

assertSameMatchResultFunction · 0.85

Tested by

no test coverage detected