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

Function TestStdlibCompat_FindSubmatchIndex

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

Source from the content-addressed store, hash-verified

485}
486
487func TestStdlibCompat_FindSubmatchIndex(t *testing.T) {
488 for _, test := range findTests {
489 t.Run(test.String(), func(t *testing.T) {
490 stdRe := regexp.MustCompile(test.pat)
491 cgRe := MustCompile(test.pat)
492
493 stdResult := stdRe.FindSubmatchIndex([]byte(test.text))
494 cgResult := cgRe.FindSubmatchIndex([]byte(test.text))
495
496 if !reflect.DeepEqual(stdResult, cgResult) {
497 t.Errorf("FindSubmatchIndex(%q, %q):\n stdlib: %v\n coregex: %v",
498 test.pat, test.text, stdResult, cgResult)
499 }
500 })
501 }
502}
503
504func TestStdlibCompat_FindStringSubmatchIndex(t *testing.T) {
505 for _, test := range findTests {

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindSubmatchIndexMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected