assertables

Module assert_program_args

source
Expand description

Assert for comparing programs with arguments.

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

These macros have corresponding macros in the module assert_command.

§Program args stdout

Compare program and arguments standard output to another program and arguments standard output:

Compare program and arguments standard output to an expression:

Assert program and arguments standard output as a string:

§Program args stderr

Compare program and arguments standard error to another program and arguments standard error:

Compare program and arguments standard error to an expression:

Assert program and arguments standard error as a string:

§Example

use assertables::*;

let a_program = "bin/printf-stdout";
let a_args = ["%s", "alfa"];
let b_program = "bin/printf-stdout";
let b_args = ["%s%s%s%s", "a", "l", "f", "a"];
assert_program_args_stdout_eq!(&a_program, &a_args, &b_program, &b_args);

Modules§