Module assertables::assert_command

source ·
Expand description

Assert macros for comparing commands and their stdout & stderr.

These macros help with calling external commands, then capturing the standard output stream and standard error stream.

These macros have corresponding the macros in the module assert_program_args.

Compare command standard output string:

Compare command standard error string:

§Example

use std::process::Command;

let mut a = Command::new("bin/printf-stdout");
a.args(["%s", "hello"]);
let mut b = Command::new("bin/printf-stdout");
b.args(["%s%s%s%s%s", "h", "e", "l", "l", "o"]);
assert_command_stdout_eq!(a, b);

Modules§