Skip to content

Commit

Permalink
Merge pull request #7369 from RenjiSann/peron/uutest-fails_with_code
Browse files Browse the repository at this point in the history
test-utils: Add fails_with_code() function
  • Loading branch information
sylvestre authored Feb 27, 2025
2 parents 0356dcc + 86aff61 commit d14ece9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/common/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,14 @@ impl UCommand {
cmd_result
}

#[track_caller]
pub fn fails_with_code(&mut self, expected_code: i32) -> CmdResult {
let cmd_result = self.run();
cmd_result.failure();
cmd_result.code_is(expected_code);
cmd_result
}

pub fn get_full_fixture_path(&self, file_rel_path: &str) -> String {
let tmpdir_path = self.tmpd.as_ref().unwrap().path();
format!("{}/{file_rel_path}", tmpdir_path.to_str().unwrap())
Expand Down

0 comments on commit d14ece9

Please sign in to comment.