mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
test_df: Use lossy stdout string
The tests fail when a non-UTF8 path is mounted, that's... not a common case, but using a lossy string works just as well for the tests, so let's use that.
This commit is contained in:
@@ -357,6 +357,11 @@ impl CmdResult {
|
||||
std::str::from_utf8(&self.stdout).unwrap()
|
||||
}
|
||||
|
||||
/// Returns the program's standard output as a string, automatically handling invalid utf8
|
||||
pub fn stdout_str_lossy(self) -> String {
|
||||
String::from_utf8_lossy(&self.stdout).to_string()
|
||||
}
|
||||
|
||||
/// Returns the program's standard output as a string
|
||||
/// consumes self
|
||||
pub fn stdout_move_str(self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user