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

Function TestStdlibCompat_Match

stdlib_compat_test.go:271–287  ·  view source on GitHub ↗

=========================================================================== Match Tests - Compare coregex vs stdlib ===========================================================================

(t *testing.T)

Source from the content-addressed store, hash-verified

269// ===========================================================================
270
271func TestStdlibCompat_Match(t *testing.T) {
272 for _, test := range findTests {
273 t.Run(test.String(), func(t *testing.T) {
274 stdRe := regexp.MustCompile(test.pat)
275 cgRe := MustCompile(test.pat)
276
277 // Test MatchString
278 stdMatchStr := stdRe.MatchString(test.text)
279 cgMatchStr := cgRe.MatchString(test.text)
280
281 if stdMatchStr != cgMatchStr {
282 t.Errorf("MatchString(%q, %q):\n stdlib: %v\n coregex: %v",
283 test.pat, test.text, stdMatchStr, cgMatchStr)
284 }
285 })
286 }
287}
288
289// ===========================================================================
290// Find Tests - Compare coregex vs stdlib

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
MatchStringMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected