Skip to content

Commit

Permalink
androidx64: test_df fails due to "." and "/" having different file sy…
Browse files Browse the repository at this point in the history
…stems

- negative testing fails when selecting by chance the filesystem of "/"
  • Loading branch information
cre4ture committed Jan 22, 2024
1 parent 9c1b869 commit 7eb164e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/by-util/test_df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,18 @@ fn test_type_option() {
#[test]
#[cfg(not(any(target_os = "freebsd", target_os = "windows")))] // FIXME: fix test for FreeBSD & Win
fn test_type_option_with_file() {
let fs_type = new_ucmd!()
let fs_type_cwd = new_ucmd!()
.args(&["--output=fstype", "."])
.succeeds()
.stdout_move_str();
let fs_type = fs_type.lines().nth(1).unwrap().trim();
let fs_type_cwd = fs_type_cwd.lines().nth(1).unwrap().trim();
let fs_type_root_dir = new_ucmd!()
.args(&["--output=fstype", "/"])
.succeeds()
.stdout_move_str();
let fs_type_root_dir = fs_type_root_dir.lines().nth(1).unwrap().trim();

new_ucmd!().args(&["-t", fs_type, "."]).succeeds();
new_ucmd!().args(&["-t", fs_type_cwd, "."]).succeeds();
new_ucmd!()
.args(&["-t", "nonexisting", "."])
.fails()
Expand All @@ -283,7 +288,7 @@ fn test_type_option_with_file() {
let fs_types: Vec<_> = fs_types
.lines()
.skip(1)
.filter(|t| t.trim() != fs_type && t.trim() != "")
.filter(|t| t.trim() != fs_type_cwd && t.trim() != fs_type_root_dir && t.trim() != "")
.collect();

if !fs_types.is_empty() {
Expand Down

0 comments on commit 7eb164e

Please sign in to comment.