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

Function TestStdlibCompat_FindString

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

Source from the content-addressed store, hash-verified

308}
309
310func TestStdlibCompat_FindString(t *testing.T) {
311 for _, test := range findTests {
312 t.Run(test.String(), func(t *testing.T) {
313 stdRe := regexp.MustCompile(test.pat)
314 cgRe := MustCompile(test.pat)
315
316 stdResult := stdRe.FindString(test.text)
317 cgResult := cgRe.FindString(test.text)
318
319 if stdResult != cgResult {
320 t.Errorf("FindString(%q, %q):\n stdlib: %q\n coregex: %q",
321 test.pat, test.text, stdResult, cgResult)
322 }
323 })
324 }
325}
326
327func TestStdlibCompat_FindIndex(t *testing.T) {
328 for _, test := range findTests {

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindStringMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected