(t *testing.T, lines []string, packages []string)
| 9 | ) |
| 10 | |
| 11 | func linesContainsPackageStatistic(t *testing.T, lines []string, packages []string) { |
| 12 | t.Helper() |
| 13 | for _, e := range packages { |
| 14 | matcher := regexp.MustCompile(fmt.Sprintf(`^%s\s+\d+\.\d+$`, regexp.QuoteMeta(e))) |
| 15 | if !slices.ContainsFunc(lines, func(v string) bool { return matcher.MatchString(v) }) { |
| 16 | t.Errorf("Expected to find '%s' in %v", e, lines) |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | func TestSearchPackages(t *testing.T) { |
| 22 | output, err := pkgstats(t, []string{"search", "php"}) |
no outgoing calls
no test coverage detected