clitools.rs: Add expect_not_stderr_ok
In order to support testing commands which may return certain
messages on `stderr` in a way in which they should *NOT*
produce such messages, add a counterpart to `expect_not_stdout_ok`.
@@ -207,6 +207,16 @@ pub fn expect_not_stdout_ok(config: &Config, args: &[&str], expected: &str) {
}
}
+pub fn expect_not_stderr_ok(config: &Config, args: &[&str], expected: &str) {
+ let out = run(config, args[0], &args[1..], &[]);
+ if out.ok || out.stderr.contains(expected) {
+ print_command(args, &out);
+ println!("expected.ok: false");
+ print_indented("expected.stderr.does_not_contain", expected);
+ panic!();
+ }
+}
+
pub fn expect_stderr_ok(config: &Config, args: &[&str], expected: &str) {
let out = run(config, args[0], &args[1..], &[]);
if !out.ok || !out.stderr.contains(expected) {
