1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

df: show error if same type is included & excluded

Fixes #3302
This commit is contained in:
Daniel Hofstetter 2022-04-05 14:21:32 +02:00
parent 5fbef7743b
commit 876924f5d5
2 changed files with 50 additions and 18 deletions

View file

@ -95,6 +95,21 @@ fn test_exclude_type_option() {
new_ucmd!().args(&["-x", "ext4", "-x", "ext3"]).succeeds();
}
#[test]
fn test_include_exclude_same_type() {
new_ucmd!()
.args(&["-t", "ext4", "-x", "ext4"])
.fails()
.stderr_is("df: file system type 'ext4' both selected and excluded");
new_ucmd!()
.args(&["-t", "ext4", "-x", "ext4", "-t", "ext3", "-x", "ext3"])
.fails()
.stderr_is(
"df: file system type 'ext4' both selected and excluded\n\
df: file system type 'ext3' both selected and excluded",
);
}
#[test]
fn test_total() {
// Example output: