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

Function assertEquivalentStringMatchStartingAt

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

Source from the content-addressed store, hash-verified

469}
470
471func assertEquivalentStringMatchStartingAt(t *testing.T, optimized, unoptimized *Regexp, input string, startAt int) {
472 t.Helper()
473
474 gotMatch, gotErr := optimized.FindStringMatchStartingAt(input, startAt)
475 wantMatch, wantErr := unoptimized.FindStringMatchStartingAt(input, startAt)
476 assertSameMatchResult(t, "FindStringMatchStartingAt", input, gotMatch, gotErr, wantMatch, wantErr)
477}
478
479func assertSameMatchResult(t *testing.T, api, input string, got *Match, gotErr error, want *Match, wantErr error) {
480 t.Helper()

Calls 2

assertSameMatchResultFunction · 0.85

Tested by

no test coverage detected