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:
assert_program_args_stdout_eq!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout = command2 with program2 and args2 to stdoutassert_program_args_stdout_ne!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout ≠ command2 with program2 and args2 to stdoutassert_program_args_stdout_lt!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout < command2 with program2 and args2 to stdoutassert_program_args_stdout_le!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout ≤ command2 with program2 and args2 to stdoutassert_program_args_stdout_gt!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout > command2 with program2 and args2 to stdoutassert_program_args_stdout_ge!(program1, args1, program2, args2)≈ command using program1 and args1 to stdout ≥ command2 with program2 and args2 to stdout
Compare program and arguments standard output to an expression:
assert_program_args_stdout_eq_expr!(program, args, expr)≈ command using program and args to stdout = exprassert_program_args_stdout_ne_expr!(program, args, expr)≈ command using program and args to stdout ≠ exprassert_program_args_stdout_lt_expr!(program, args, expr)≈ command using program and args to stdout < exprassert_program_args_stdout_le_expr!(program, args, expr)≈ command using program and args to stdout ≤ exprassert_program_args_stdout_gt_expr!(program, args, expr)≈ command using program and args to stdout > exprassert_program_args_stdout_ge_expr!(program, args, expr)≈ command using program and args to stdout ≥ expr
Assert program and arguments standard output as a string:
assert_program_args_stdout_string_contains!(program, args, containee)≈ command using program and args to stdout string contains containeeassert_program_args_stdout_string_is_match!(program, args, matcher)≈ matcher is match with command using program and args
§Program args stderr
Compare program and arguments standard error to another program and arguments standard error:
assert_program_args_stderr_eq!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr = command2 with program2 and args2 to stderrassert_program_args_stderr_ne!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr ≠ command2 with program2 and args2 to stderrassert_program_args_stderr_lt!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr < command2 with program2 and args2 to stderrassert_program_args_stderr_le!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr ≤ command2 with program2 and args2 to stderrassert_program_args_stderr_gt!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr > command2 with program2 and args2 to stderrassert_program_args_stderr_ge!(program1, args1, program2, args2)≈ command using program1 and args1 to stderr ≥ command2 with program2 and args2 to stderr
Compare program and arguments standard error to an expression:
assert_program_args_stderr_eq_expr!(program, args, expr)≈ command using program and args to stderr = exprassert_program_args_stderr_ne_expr!(program, args, expr)≈ command using program and args to stderr ≠ exprassert_program_args_stderr_lt_expr!(program, args, expr)≈ command using program and args to stderr < exprassert_program_args_stderr_le_expr!(program, args, expr)≈ command using program and args to stderr ≤ exprassert_program_args_stderr_gt_expr!(program, args, expr)≈ command using program and args to stderr > exprassert_program_args_stderr_ge_expr!(program, args, expr)≈ command using program and args to stderr ≥ expr
Assert program and arguments standard error as a string:
assert_program_args_stderr_string_contains!(program, args, containee)≈ command using program and args to stderr string contains containeeassert_program_args_stderr_string_is_match!(program, args, matcher)≈ matcher is match with command using program and args
§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§
- 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) stderr string contains a given containee.
- Assert a command (built with program and args) stderr string is a match to a regex.
- 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.
- 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 a match to a regex.