Deprecated: prefer exact matches for command output
(t T, output string, lines ...string)
| 47 | |
| 48 | // Deprecated: prefer exact matches for command output |
| 49 | func ExpectLines(t T, output string, lines ...string) { |
| 50 | t.Helper() |
| 51 | var r *regexp.Regexp |
| 52 | for _, l := range lines { |
| 53 | r = regexp.MustCompile(l) |
| 54 | if !r.MatchString(output) { |
| 55 | t.Errorf("output did not match regexp /%s/\n> output\n%s\n", r, output) |
| 56 | return |
| 57 | } |
| 58 | } |
| 59 | } |