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

Function TestStdlibCompat_FindAllStringIndex

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

Source from the content-addressed store, hash-verified

422}
423
424func TestStdlibCompat_FindAllStringIndex(t *testing.T) {
425 for _, test := range findTests {
426 t.Run(test.String(), func(t *testing.T) {
427 stdRe := regexp.MustCompile(test.pat)
428 cgRe := MustCompile(test.pat)
429
430 stdResult := stdRe.FindAllStringIndex(test.text, -1)
431 cgResult := cgRe.FindAllStringIndex(test.text, -1)
432
433 if !reflect.DeepEqual(stdResult, cgResult) {
434 t.Errorf("FindAllStringIndex(%q, %q):\n stdlib: %v\n coregex: %v",
435 test.pat, test.text, stdResult, cgResult)
436 }
437 })
438 }
439}
440
441// ===========================================================================
442// Submatch Tests - Compare coregex vs stdlib

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindAllStringIndexMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected