macro_rules! assert_command_stdout_lt {
($a_command:expr, $b_command:expr $(,)?) => { ... };
($a_command:expr, $b_command:expr, $($message:tt)+) => { ... };
}
Expand description
Assert a command stdout string is less than another.
Pseudocode:
(a_command ⇒ stdout) = (b_command ⇒ stdout)
-
If true, return
(a_stdout, b_stdout)
. -
Otherwise, call
panic!
with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
use std::process::Command;
let mut a = Command::new("bin/printf-stdout");
a.args(["%s", "alfa"]);
let mut b = Command::new("bin/printf-stdout");
b.args(["%s", "zz"]);
assert_command_stdout_lt!(a, b);
// This will panic
let mut a = Command::new("bin/printf-stdout");
a.args(["%s", "alfa"]);
let mut b = Command::new("bin/printf-stdout");
b.args(["%s", "aa"]);
assert_command_stdout_lt!(a, b);
// assertion failed: `assert_command_stdout_lt!(a_command, b_command)`
// https://docs.rs/assertables/…/assertables/macro.assert_command_stdout_lt.html
// a label: `a`,
// a debug: `\"bin/printf-stdout\" \"%s\" \"alfa\"`,
// b label: `b`,
// b debug: `\"bin/printf-stdout\" \"%s\" \"aa\"`,
// a value: `[97, 108, 102, 97]`,
// b value: `[97, 997]`