Skip to content

Commit 232cedb

Browse files
committed
test(complete): Remove redundant index
1 parent 02244a6 commit 232cedb

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

clap_complete/tests/testsuite/engine.rs

+3-20
Original file line numberDiff line numberDiff line change
@@ -680,15 +680,10 @@ baz
680680
#[test]
681681
fn suggest_multi_positional() {
682682
let mut cmd = Command::new("dynamic")
683-
.arg(
684-
clap::Arg::new("positional-1")
685-
.value_parser(["pos_1"])
686-
.index(1),
687-
)
683+
.arg(clap::Arg::new("positional-1").value_parser(["pos_1"]))
688684
.arg(
689685
clap::Arg::new("positional-2")
690686
.value_parser(["pos_2_a", "pos_2_b", "pos_2_c"])
691-
.index(2)
692687
.num_args(3),
693688
)
694689
.arg(
@@ -774,7 +769,6 @@ fn suggest_multi_positional_unbounded() {
774769
.arg(
775770
clap::Arg::new("positional")
776771
.value_parser(["pos_1", "pos_2"])
777-
.index(1)
778772
.num_args(2..),
779773
)
780774
.arg(
@@ -847,7 +841,6 @@ fn suggest_delimiter_values() {
847841
)
848842
.arg(
849843
clap::Arg::new("pos")
850-
.index(1)
851844
.value_parser(["a_pos", "b_pos", "c_pos"])
852845
.value_delimiter(','),
853846
);
@@ -1046,14 +1039,9 @@ fn suggest_positional_long_allow_hyphen() {
10461039
.arg(
10471040
clap::Arg::new("positional_a")
10481041
.value_parser(["--pos_a"])
1049-
.index(1)
10501042
.allow_hyphen_values(true),
10511043
)
1052-
.arg(
1053-
clap::Arg::new("positional_b")
1054-
.index(2)
1055-
.value_parser(["pos_b"]),
1056-
);
1044+
.arg(clap::Arg::new("positional_b").value_parser(["pos_b"]));
10571045

10581046
assert_data_eq!(
10591047
complete!(cmd, "--format --json --pos[TAB]"),
@@ -1104,14 +1092,9 @@ fn suggest_positional_short_allow_hyphen() {
11041092
.arg(
11051093
clap::Arg::new("positional_a")
11061094
.value_parser(["-a"])
1107-
.index(1)
11081095
.allow_hyphen_values(true),
11091096
)
1110-
.arg(
1111-
clap::Arg::new("positional_b")
1112-
.index(2)
1113-
.value_parser(["pos_b"]),
1114-
);
1097+
.arg(clap::Arg::new("positional_b").value_parser(["pos_b"]));
11151098

11161099
assert_data_eq!(
11171100
complete!(cmd, "--format --json -a [TAB]"),

0 commit comments

Comments
 (0)