Skip to content

Commit

Permalink
run-make-support: improve docs for assert_exit_code
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Jan 25, 2025
1 parent 9a4a2f1 commit bd2a222
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tools/run-make-support/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,15 @@ impl CompletedProcess {
self
}

/// Check the **exit status** of the process. On Unix, this is *not* the **wait status**.
///
/// See [`std::process::ExitStatus::code`]. This is not to be confused with
/// [`std::process::ExitCode`].
#[track_caller]
pub fn assert_exit_code(&self, code: i32) -> &Self {
assert!(self.output.status.code() == Some(code));
// FIXME(jieyouxu): this should really be named `exit_status`, because std has an `ExitCode`
// that means a different thing.
assert_eq!(self.output.status.code(), Some(code));
self
}
}
Expand Down

0 comments on commit bd2a222

Please sign in to comment.