mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
Add tests to check link fails with 1 or 3 argument(s)
This commit is contained in:
parent
c579bdb8d5
commit
0e6b63b47b
1 changed files with 22 additions and 0 deletions
|
@ -39,3 +39,25 @@ fn test_link_nonexistent_file() {
|
|||
assert!(!at.file_exists(file));
|
||||
assert!(!at.file_exists(link));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_link_one_argument() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
let file = "test_link_argument";
|
||||
ucmd.args(&[file]).fails().stderr_contains(
|
||||
"error: The argument '<FILES>...' requires at least 2 values, but only 1 was provide",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_link_three_arguments() {
|
||||
let (_, mut ucmd) = at_and_ucmd!();
|
||||
let arguments = vec![
|
||||
"test_link_argument1",
|
||||
"test_link_argument2",
|
||||
"test_link_argument3",
|
||||
];
|
||||
ucmd.args(&arguments[..]).fails().stderr_contains(
|
||||
format!("error: The value '{}' was provided to '<FILES>...', but it wasn't expecting any more values", arguments[2]),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue