mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
df: fix tests of internal helper functions
Fix unit tests for the `is_included()` and `filter_mount_list()` internal helper functions. The function signatures changed but the tests did not get updated to match.
This commit is contained in:
parent
ebd0c09549
commit
9fae445ca9
1 changed files with 13 additions and 50 deletions
|
@ -583,9 +583,8 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_remote_included() {
|
fn test_remote_included() {
|
||||||
let opt = Default::default();
|
let opt = Default::default();
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", true, false);
|
let m = mount_info("ext4", "/mnt/foo", true, false);
|
||||||
assert!(is_included(&m, &paths, &opt));
|
assert!(is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -594,9 +593,8 @@ mod tests {
|
||||||
show_local_fs: true,
|
show_local_fs: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", true, false);
|
let m = mount_info("ext4", "/mnt/foo", true, false);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -606,17 +604,15 @@ mod tests {
|
||||||
show_listed_fs: true,
|
show_listed_fs: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, true);
|
let m = mount_info("ext4", "/mnt/foo", false, true);
|
||||||
assert!(is_included(&m, &paths, &opt));
|
assert!(is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_dummy_excluded() {
|
fn test_dummy_excluded() {
|
||||||
let opt = Default::default();
|
let opt = Default::default();
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, true);
|
let m = mount_info("ext4", "/mnt/foo", false, true);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -630,9 +626,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -646,9 +641,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(is_included(&m, &paths, &opt));
|
assert!(is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -662,9 +656,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(is_included(&m, &paths, &opt));
|
assert!(is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -678,9 +671,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -692,9 +684,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -706,9 +697,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -720,9 +710,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(is_included(&m, &paths, &opt));
|
assert!(is_included(&m, &opt));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -737,33 +726,8 @@ mod tests {
|
||||||
fs_selector,
|
fs_selector,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
let m = mount_info("ext4", "/mnt/foo", false, false);
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
assert!(!is_included(&m, &opt));
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_paths_empty() {
|
|
||||||
let opt = Default::default();
|
|
||||||
let paths = [];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
|
||||||
assert!(is_included(&m, &paths, &opt));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_not_in_paths() {
|
|
||||||
let opt = Default::default();
|
|
||||||
let paths = [String::from("/mnt/foo")];
|
|
||||||
let m = mount_info("ext4", "/mnt/bar", false, false);
|
|
||||||
assert!(!is_included(&m, &paths, &opt));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_in_paths() {
|
|
||||||
let opt = Default::default();
|
|
||||||
let paths = [String::from("/mnt/foo")];
|
|
||||||
let m = mount_info("ext4", "/mnt/foo", false, false);
|
|
||||||
assert!(is_included(&m, &paths, &opt));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -774,9 +738,8 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_empty() {
|
fn test_empty() {
|
||||||
let opt = Default::default();
|
let opt = Default::default();
|
||||||
let paths = [];
|
|
||||||
let mount_infos = vec![];
|
let mount_infos = vec![];
|
||||||
assert!(filter_mount_list(mount_infos, &paths, &opt).is_empty());
|
assert!(filter_mount_list(mount_infos, &opt).is_empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue