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

Function TestStdlibCompat_FindIndex

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

Source from the content-addressed store, hash-verified

325}
326
327func TestStdlibCompat_FindIndex(t *testing.T) {
328 for _, test := range findTests {
329 t.Run(test.String(), func(t *testing.T) {
330 stdRe := regexp.MustCompile(test.pat)
331 cgRe := MustCompile(test.pat)
332
333 stdResult := stdRe.FindStringIndex(test.text)
334 cgResult := cgRe.FindStringIndex(test.text)
335
336 if !reflect.DeepEqual(stdResult, cgResult) {
337 t.Errorf("FindStringIndex(%q, %q):\n stdlib: %v\n coregex: %v",
338 test.pat, test.text, stdResult, cgResult)
339 }
340 })
341 }
342}
343
344func TestStdlibCompat_FindStringIndex(t *testing.T) {
345 for _, test := range findTests {

Callers

nothing calls this directly

Calls 3

MustCompileFunction · 0.85
FindStringIndexMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected