MCPcopy
hub / github.com/kopia/kopia / RunAndExpectSuccessWithErrOut

Method RunAndExpectSuccessWithErrOut

tests/testenv/cli_test_env.go:251–258  ·  view source on GitHub ↗

RunAndExpectSuccessWithErrOut runs the given command, expects it to succeed and returns its stdout and stderr lines.

(tb testing.TB, args ...string)

Source from the content-addressed store, hash-verified

249
250// RunAndExpectSuccessWithErrOut runs the given command, expects it to succeed and returns its stdout and stderr lines.
251func (e *CLITest) RunAndExpectSuccessWithErrOut(tb testing.TB, args ...string) (stdout, stderr []string) {
252 tb.Helper()
253
254 stdout, stderr, err := e.Run(tb, false, args...)
255 require.NoError(tb, err, "'kopia %v' failed", strings.Join(args, " "))
256
257 return stdout, stderr
258}
259
260// RunAndExpectFailure runs the given command, expects it to fail and returns its output lines.
261func (e *CLITest) RunAndExpectFailure(tb testing.TB, args ...string) (stdout, stderr []string) {

Calls 2

RunMethod · 0.95
HelperMethod · 0.80