Revert "Add partial_mut_args test"

This reverts commit 1c73c46af9.
This commit is contained in:
Ed Page 2021-11-05 09:28:20 -05:00
parent 2537894c4b
commit 3e838d1b77

View file

@ -130,19 +130,6 @@ SUBCOMMANDS:
";
static PARTIAL_MUT_ARGS: &str = "myprog 3.0
USAGE:
myprog [OPTIONS]
OPTIONS:
--first first about
-h, --help Print help information
--second [env: ENV_REPLACED=]
--third third arg
-V, --version Print version information
";
#[test]
fn setting() {
let m = App::new("setting").setting(AppSettings::AllArgsOverrideSelf);
@ -1249,26 +1236,3 @@ fn no_auto_version_mut_args() {
assert!(result.is_ok());
assert!(result.unwrap().is_present("version"));
}
#[test]
fn partial_mut_args() {
let app = App::new("myprog")
.version("3.0")
.arg(
Arg::new("first").long("first").about("first arg"), // this about will be replaced
)
.arg(Arg::new("second").long("second").env("ENV_SECOND")) // this env will be replaced
.arg(Arg::new("third").long("third").about("third arg")) // this will not be mutated
.mut_args(|v| match v.get_name() {
"first" => Some(v.about("first about")),
"second" => Some(v.env("ENV_REPLACED")),
_ => None,
});
assert!(utils::compare_output(
app,
"myprog -h",
PARTIAL_MUT_ARGS,
false
));
}