From d68eee296e49e5a189ad826cffa11ade7bdd3328 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 27 Mar 2022 20:08:54 -0700 Subject: [PATCH] tests: check that stderr is empty after successful commands Successful commands should probably not write to stderr. If we later add commands that e.g. print warnings to stderr, we'll want to cover that explicitly in test. --- src/testutils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testutils.rs b/src/testutils.rs index b10e9e1c2..2b992b432 100644 --- a/src/testutils.rs +++ b/src/testutils.rs @@ -66,7 +66,7 @@ impl TestEnvironment { /// Run a `jj` command, check that it was successful, and return its stdout pub fn jj_cmd_success(&self, current_dir: &Path, args: &[&str]) -> String { - let assert = self.jj_cmd(current_dir, args).assert().success(); + let assert = self.jj_cmd(current_dir, args).assert().success().stderr(""); get_stdout_string(&assert) }