mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Merge pull request #2391 from jhscheer/cmdresult_new
tests/util: add CmdResult::new()
This commit is contained in:
commit
a8c5ffc024
1 changed files with 16 additions and 0 deletions
|
@ -69,6 +69,22 @@ pub struct CmdResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CmdResult {
|
impl CmdResult {
|
||||||
|
pub fn new(
|
||||||
|
tmpd: Option<Rc<TempDir>>,
|
||||||
|
code: Option<i32>,
|
||||||
|
success: bool,
|
||||||
|
stdout: &[u8],
|
||||||
|
stderr: &[u8],
|
||||||
|
) -> CmdResult {
|
||||||
|
CmdResult {
|
||||||
|
tmpd,
|
||||||
|
code,
|
||||||
|
success,
|
||||||
|
stdout: stdout.to_vec(),
|
||||||
|
stderr: stderr.to_vec(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a reference to the program's standard output as a slice of bytes
|
/// Returns a reference to the program's standard output as a slice of bytes
|
||||||
pub fn stdout(&self) -> &[u8] {
|
pub fn stdout(&self) -> &[u8] {
|
||||||
&self.stdout
|
&self.stdout
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue