=========================================================================== Find Tests - Compare coregex vs stdlib ===========================================================================
(t *testing.T)
| 291 | // =========================================================================== |
| 292 | |
| 293 | func 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 | |
| 310 | func TestStdlibCompat_FindString(t *testing.T) { |
| 311 | for _, test := range findTests { |
nothing calls this directly
no test coverage detected