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

Function TestStdlibCompat_FindStringSubmatchIndex

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

Source from the content-addressed store, hash-verified

502}
503
504func TestStdlibCompat_FindStringSubmatchIndex(t *testing.T) {
505 for _, test := range findTests {
506 t.Run(test.String(), func(t *testing.T) {
507 stdRe := regexp.MustCompile(test.pat)
508 cgRe := MustCompile(test.pat)
509
510 stdResult := stdRe.FindStringSubmatchIndex(test.text)
511 cgResult := cgRe.FindStringSubmatchIndex(test.text)
512
513 if !reflect.DeepEqual(stdResult, cgResult) {
514 t.Errorf("FindStringSubmatchIndex(%q, %q):\n stdlib: %v\n coregex: %v",
515 test.pat, test.text, stdResult, cgResult)
516 }
517 })
518 }
519}
520
521// ===========================================================================
522// FindAllSubmatch Tests - Compare coregex vs stdlib

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected