Trait testcall::TestOutput [−][src]
pub trait TestOutput { fn assert_success(&self) -> &Self; fn assert_failure(&self) -> &Self; fn assert_exitcode(&self, code: i32) -> &Self; fn assert_stdout_utf8(&self, regex: &str) -> &Self; fn assert_stderr_utf8(&self, regex: &str) -> &Self; fn assert_stdout_bytes(&self, regex: &str) -> &Self; fn assert_stderr_bytes(&self, regex: &str) -> &Self; fn stdout_captures_utf8(&self, regex: &str) -> Captured; fn stderr_captures_utf8(&self, regex: &str) -> Captured; }
Expand description
Augment std::process::Output with testing and assertions
Required methods
fn assert_success(&self) -> &Self
fn assert_success(&self) -> &Self
Will panic when the program did not exited successful.
fn assert_failure(&self) -> &Self
fn assert_failure(&self) -> &Self
Expects that the program exited with a failure.
fn assert_exitcode(&self, code: i32) -> &Self
fn assert_exitcode(&self, code: i32) -> &Self
Expects that the program exited with the provided code.
fn assert_stdout_utf8(&self, regex: &str) -> &Self
fn assert_stdout_utf8(&self, regex: &str) -> &Self
Applies a regex match check to stdout, will panic when the match failed. This check matches utf8 text, stdout is lossy convered to utf8 first.
fn assert_stderr_utf8(&self, regex: &str) -> &Self
fn assert_stderr_utf8(&self, regex: &str) -> &Self
Applies a regex match check to stderr, will panic when the match failed. This check matches utf8 text, stdout is lossy convered to utf8 first.
fn assert_stdout_bytes(&self, regex: &str) -> &Self
fn assert_stdout_bytes(&self, regex: &str) -> &Self
Applies a regex match check to stdout, will panic when the match failed. This check uses the ‘bytes’ module from the regex package and matches bytes.
fn assert_stderr_bytes(&self, regex: &str) -> &Self
fn assert_stderr_bytes(&self, regex: &str) -> &Self
Applies a regex match check to stderr, will panic when the match failed. This check uses the ‘bytes’ module from the regex package and matches bytes.
fn stdout_captures_utf8(&self, regex: &str) -> Captured
fn stdout_captures_utf8(&self, regex: &str) -> Captured
Applies a regex on stdout, returns named captures as CaptureKey:String map. Matches utf8 text, input is lossy convered to utf8 first.
fn stderr_captures_utf8(&self, regex: &str) -> Captured
fn stderr_captures_utf8(&self, regex: &str) -> Captured
Applies a regex on stderr, returns named captures as CaptureKey:String map. Matches utf8 text, input is lossy convered to utf8 first.