MCPcopy Create free account
hub / github.com/containerd/nerdctl / AssertOutContainsAll

Method AssertOutContainsAll

pkg/testutil/testutil.go:417–428  ·  view source on GitHub ↗

AssertOutContainsAll checks if command output contains All strings in `strs`.

(strs ...string)

Source from the content-addressed store, hash-verified

415
416// AssertOutContainsAll checks if command output contains All strings in `strs`.
417func (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`.
431func (c *Cmd) AssertOutContainsAny(strs ...string) {

Callers 1

TestRunMountVolumeFunction · 0.80

Calls 2

AssertOutWithFuncMethod · 0.95
HelperMethod · 0.65

Tested by 1

TestRunMountVolumeFunction · 0.64