MCPcopy Create free account
hub / github.com/coregx/coregex / TestStdlibCompat_FindStringIndex

Function TestStdlibCompat_FindStringIndex

stdlib_compat_test.go:344–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

342}
343
344func TestStdlibCompat_FindStringIndex(t *testing.T) {
345 for _, test := range findTests {
346 t.Run(test.String(), func(t *testing.T) {
347 stdRe := regexp.MustCompile(test.pat)
348 cgRe := MustCompile(test.pat)
349
350 stdResult := stdRe.FindStringIndex(test.text)
351 cgResult := cgRe.FindStringIndex(test.text)
352
353 if !reflect.DeepEqual(stdResult, cgResult) {
354 t.Errorf("FindStringIndex(%q, %q):\n stdlib: %v\n coregex: %v",
355 test.pat, test.text, stdResult, cgResult)
356 }
357 })
358 }
359}
360
361// ===========================================================================
362// FindAll Tests - Compare coregex vs stdlib

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindStringIndexMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected