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

Method AssertOutWithFunc

pkg/testutil/testutil.go:465–470  ·  view source on GitHub ↗
(fn func(stdout string) error)

Source from the content-addressed store, hash-verified

463}
464
465func (c *Cmd) AssertOutWithFunc(fn func(stdout string) error) {
466 c.Base.T.Helper()
467 res := c.runIfNecessary()
468 assert.Equal(c.Base.T, 0, res.ExitCode, res)
469 assert.NilError(c.Base.T, fn(res.Stdout()), res.Combined())
470}
471
472func (c *Cmd) Out() string {
473 c.Base.T.Helper()

Callers 15

AssertOutContainsAllMethod · 0.95
AssertOutContainsAnyMethod · 0.95
AssertOutNotContainsMethod · 0.95
AssertOutExactlyMethod · 0.95
TestContainerListFunction · 0.80
TestRunAddHostFunction · 0.80

Calls 2

runIfNecessaryMethod · 0.95
HelperMethod · 0.65

Tested by 15

TestContainerListFunction · 0.64
TestRunAddHostFunction · 0.64
TestRunGPUFunction · 0.64
TestListProcessContainerFunction · 0.64