AssertOutContainsAll checks if command output contains All strings in `strs`.
(strs ...string)
| 415 | |
| 416 | // AssertOutContainsAll checks if command output contains All strings in `strs`. |
| 417 | func (c *Cmd) AssertOutContainsAll(strs ...string) { |
| 418 | c.Base.T.Helper() |
| 419 | fn := func(stdout string) error { |
| 420 | for _, s := range strs { |
| 421 | if !strings.Contains(stdout, s) { |
| 422 | return fmt.Errorf("expected stdout to contain %q", s) |
| 423 | } |
| 424 | } |
| 425 | return nil |
| 426 | } |
| 427 | c.AssertOutWithFunc(fn) |
| 428 | } |
| 429 | |
| 430 | // AssertOutContainsAny checks if command output contains Any string in `strs`. |
| 431 | func (c *Cmd) AssertOutContainsAny(strs ...string) { |