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

Function TestStdlibCompat_FindStringSubmatch

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

Source from the content-addressed store, hash-verified

468}
469
470func TestStdlibCompat_FindStringSubmatch(t *testing.T) {
471 for _, test := range findTests {
472 t.Run(test.String(), func(t *testing.T) {
473 stdRe := regexp.MustCompile(test.pat)
474 cgRe := MustCompile(test.pat)
475
476 stdResult := stdRe.FindStringSubmatch(test.text)
477 cgResult := cgRe.FindStringSubmatch(test.text)
478
479 if !reflect.DeepEqual(stdResult, cgResult) {
480 t.Errorf("FindStringSubmatch(%q, %q):\n stdlib: %v\n coregex: %v",
481 test.pat, test.text, stdResult, cgResult)
482 }
483 })
484 }
485}
486
487func TestStdlibCompat_FindSubmatchIndex(t *testing.T) {
488 for _, test := range findTests {

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindStringSubmatchMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected