mirror of
https://github.com/bootandy/dust.git
synced 2026-02-04 19:11:46 -08:00
Tests: Check stderr is empty in test_flags
For each test_flag test using the build_command helper method, check that stderr is empty
This commit is contained in:
@@ -9,11 +9,15 @@ use std::str;
|
||||
*/
|
||||
|
||||
fn build_command<T: AsRef<OsStr>>(command_args: Vec<T>) -> String {
|
||||
let mut a = &mut Command::cargo_bin("dust").unwrap();
|
||||
let mut cmd = &mut Command::cargo_bin("dust").unwrap();
|
||||
for p in command_args {
|
||||
a = a.arg(p);
|
||||
cmd = cmd.arg(p);
|
||||
}
|
||||
str::from_utf8(&a.unwrap().stdout).unwrap().into()
|
||||
let finished = &cmd.unwrap();
|
||||
let stderr = str::from_utf8(&finished.stderr).unwrap();
|
||||
assert_eq!(stderr, "");
|
||||
|
||||
str::from_utf8(&finished.stdout).unwrap().into()
|
||||
}
|
||||
|
||||
// We can at least test the file names are there
|
||||
|
||||
Reference in New Issue
Block a user