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:
Nicolas Boichat
2025-07-24 09:39:18 +08:00
parent 6cc3eda8e4
commit 6884e29f97
2 changed files with 44 additions and 39 deletions
+5
View File
@@ -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 {