mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 20:17:45 +00:00
test-utils: Add fails_with_code() function
This commit is contained in:
parent
0356dcc022
commit
86aff6186a
1 changed files with 8 additions and 0 deletions
|
@ -1834,6 +1834,14 @@ impl UCommand {
|
||||||
cmd_result
|
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 {
|
pub fn get_full_fixture_path(&self, file_rel_path: &str) -> String {
|
||||||
let tmpdir_path = self.tmpd.as_ref().unwrap().path();
|
let tmpdir_path = self.tmpd.as_ref().unwrap().path();
|
||||||
format!("{}/{file_rel_path}", tmpdir_path.to_str().unwrap())
|
format!("{}/{file_rel_path}", tmpdir_path.to_str().unwrap())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue