Expand description
Assert macros 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.
Compare command using program and arguments to standard output:
-
assert_program_args_stdout_eq!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout = command2 with program2 and args2 to stdout -
assert_program_args_stdout_eq_expr!(program, args, expr)≈ command using program and args to stdout = expr -
assert_program_args_stdout_contains!(program, args, containee)≈ command using program and args to stdout contains containee -
assert_program_args_stdout_is_match!(program, args, matcher)≈ matcher is match with command using program and args
Compare command using program and arguments to standard output:
-
assert_program_args_stderr_eq!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr = command2 with program2 and args2 to stderr -
assert_program_args_stderr_eq_expr!(program, args, expr)≈ command using program and args to stderr = expr -
assert_program_args_stderr_contains!(program, args, containee)≈ command using program and args to stderr contains containee -
assert_program_args_stderr_is_match!(program, args, matcher)≈ matcher is match with command using program and args
§Example
let a_program = "bin/printf-stdout";
let a_args = ["%s", "hello"];
let b_program = "bin/printf-stdout";
let b_args = ["%s%s%s%s%s", "h", "e", "l", "l", "o"];
assert_program_args_stdout_eq!(&a_program, &a_args, &b_program, &b_args);Modules§
- Assert a command (built with program and args) stderr string contains a given containee.
- Assert a command (built with program and args) stderr string is equal to another.
- Assert a command (built with program and args) stderr string is equal to an expression.
- Assert a command (built with program and args) stderr string is greater than or equal to another.
- Assert a command (built with program and args) stderr string is greater than or equal to an expression.
- Assert a command (built with program and args) stderr string is greater than to another.
- Assert a command (built with program and args) stderr string is greater than an expression.
- Assert a command (built with program and args) stderr string is a match to a regex.
- Assert a command (built with program and args) stderr string is less than or equal to another.
- Assert a command (built with program and args) stderr string is less than or equal to an expression.
- Assert a command (built with program and args) stderr string is less than another.
- Assert a command (built with program and args) stderr string is less than an expression.
- Assert a command (built with program and args) stderr string is not equal to another.
- Assert a command (built with program and args) stderr string is not equal to an expression.
- Assert a command (built with program and args) stdout string contains a given containee.
- Assert a command (built with program and args) stdout string is equal to another.
- Assert a command (built with program and args) stdout string is equal to an expression.
- Assert a command (built with program and args) stdout string is greater than or equal to another.
- Assert a command (built with program and args) stdout string is greater than or equal to an expression.
- Assert a command (built with program and args) stdout string is greater than another.
- Assert a command (built with program and args) stdout string is greater than an expression.
- Assert a command (built with program and args) stdout string is a match to a regex.
- Assert a command (built with program and args) stdout string is less than or equal to another.
- Assert a command (built with program and args) stdout string is less than or equal to an expression.
- Assert a command (built with program and args) stdout string is less than another.
- Assert a command (built with program and args) stdout string is less than an expression.
- Assert a command (built with program and args) stdout string is not equal to another.
- Assert a command (built with program and args) stdout string is not equal to an expression.