diff --git a/tests/common/util.rs b/tests/common/util.rs index d60fb3952..c7ac816e1 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -907,7 +907,7 @@ impl UCommand { /// Add a parameter to the invocation. Path arguments are treated relative /// to the test environment directory. pub fn arg>(&mut self, arg: S) -> &mut UCommand { - assert!(!self.has_run, ALREADY_RUN); + assert!(!self.has_run, "{}", ALREADY_RUN); self.comm_string.push(' '); self.comm_string .push_str(arg.as_ref().to_str().unwrap_or_default()); @@ -918,7 +918,7 @@ impl UCommand { /// Add multiple parameters to the invocation. Path arguments are treated relative /// to the test environment directory. pub fn args>(&mut self, args: &[S]) -> &mut UCommand { - assert!(!self.has_run, MULTIPLE_STDIN_MEANINGLESS); + assert!(!self.has_run, "{}", MULTIPLE_STDIN_MEANINGLESS); let strings = args .iter() .map(|s| s.as_ref().to_os_string()) @@ -936,7 +936,11 @@ impl UCommand { /// provides standard input to feed in to the command when spawned pub fn pipe_in>>(&mut self, input: T) -> &mut UCommand { - assert!(!self.bytes_into_stdin.is_some(), MULTIPLE_STDIN_MEANINGLESS); + assert!( + !self.bytes_into_stdin.is_some(), + "{}", + MULTIPLE_STDIN_MEANINGLESS + ); self.bytes_into_stdin = Some(input.into()); self } @@ -951,7 +955,7 @@ impl UCommand { /// This is typically useful to test non-standard workflows /// like feeding something to a command that does not read it pub fn ignore_stdin_write_error(&mut self) -> &mut UCommand { - assert!(!self.bytes_into_stdin.is_none(), NO_STDIN_MEANINGLESS); + assert!(!self.bytes_into_stdin.is_none(), "{}", NO_STDIN_MEANINGLESS); self.ignore_stdin_write_error = true; self } @@ -961,7 +965,7 @@ impl UCommand { K: AsRef, V: AsRef, { - assert!(!self.has_run, ALREADY_RUN); + assert!(!self.has_run, "{}", ALREADY_RUN); self.raw.env(key, val); self } @@ -980,7 +984,7 @@ impl UCommand { /// Spawns the command, feeds the stdin if any, and returns the /// child process immediately. pub fn run_no_wait(&mut self) -> Child { - assert!(!self.has_run, ALREADY_RUN); + assert!(!self.has_run, "{}", ALREADY_RUN); self.has_run = true; log_info("run", &self.comm_string); let mut child = self