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

Function TestStdlibCompat_Find

stdlib_compat_test.go:293–308  ·  view source on GitHub ↗

=========================================================================== Find Tests - Compare coregex vs stdlib ===========================================================================

(t *testing.T)

Source from the content-addressed store, hash-verified

291// ===========================================================================
292
293func TestStdlibCompat_Find(t *testing.T) {
294 for _, test := range findTests {
295 t.Run(test.String(), func(t *testing.T) {
296 stdRe := regexp.MustCompile(test.pat)
297 cgRe := MustCompile(test.pat)
298
299 stdResult := stdRe.Find([]byte(test.text))
300 cgResult := cgRe.Find([]byte(test.text))
301
302 if !reflect.DeepEqual(stdResult, cgResult) {
303 t.Errorf("Find(%q, %q):\n stdlib: %q\n coregex: %q",
304 test.pat, test.text, stdResult, cgResult)
305 }
306 })
307 }
308}
309
310func TestStdlibCompat_FindString(t *testing.T) {
311 for _, test := range findTests {

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected