fix(pipeline): use OsString in tests
Signed-off-by: Charlotte Meyer <dev@buffet.sh>
This commit is contained in:
parent
eb78097206
commit
a5d971de35
1 changed files with 4 additions and 6 deletions
|
@ -1,10 +1,10 @@
|
|||
use std::{
|
||||
borrow::Cow,
|
||||
env,
|
||||
ffi::OsStr,
|
||||
ffi::{OsStr, OsString},
|
||||
fs::File,
|
||||
io::{BufRead, BufReader, Write},
|
||||
os::unix::io::FromRawFd,
|
||||
os::unix::{ffi::OsStringExt, io::FromRawFd},
|
||||
process,
|
||||
};
|
||||
|
||||
|
@ -30,7 +30,7 @@ fn test_builtin(_: &mut Shell, _: &[Cow<OsStr>]) {
|
|||
|
||||
/// Forks to redirect stdin, stderr, stdout, then run the commands.
|
||||
/// Relies on inserting a NUL byte in the end, so there shouldn't be NUL in the output.
|
||||
fn collect_output<F>(mut f: F) -> String
|
||||
fn collect_output<F>(mut f: F) -> OsString
|
||||
where
|
||||
F: FnMut(),
|
||||
{
|
||||
|
@ -65,9 +65,7 @@ where
|
|||
let mut buf = vec![];
|
||||
r.read_until(0, &mut buf).unwrap();
|
||||
|
||||
std::str::from_utf8(&buf[..buf.len() - 1])
|
||||
.unwrap()
|
||||
.to_owned()
|
||||
OsString::from_vec(buf[..buf.len() - 1].to_vec())
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue