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

add some tests for Clap's InferLongArgs setting

This commit is contained in:
Terts Diepraam 2022-01-29 01:03:28 +01:00
parent 5f1933a89f
commit 2412e4cbf7
11 changed files with 166 additions and 110 deletions

View file

@ -61,7 +61,7 @@ fn test_do_not_remove_suffix() {
#[test]
fn test_multiple_param() {
for &multiple_param in &["-a", "--multiple"] {
for &multiple_param in &["-a", "--multiple", "--mul"] {
let path = "/foo/bar/baz";
new_ucmd!()
.args(&[multiple_param, path, path])
@ -72,7 +72,7 @@ fn test_multiple_param() {
#[test]
fn test_suffix_param() {
for &suffix_param in &["-s", "--suffix"] {
for &suffix_param in &["-s", "--suffix", "--suf"] {
let path = "/foo/bar/baz.exe";
new_ucmd!()
.args(&[suffix_param, ".exe", path, path])
@ -83,7 +83,7 @@ fn test_suffix_param() {
#[test]
fn test_zero_param() {
for &zero_param in &["-z", "--zero"] {
for &zero_param in &["-z", "--zero", "--ze"] {
let path = "/foo/bar/baz";
new_ucmd!()
.args(&[zero_param, "-a", path, path])