Skip to content

Commit

Permalink
test: fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Mar 16, 2024
1 parent 7026baf commit be8d6d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/parse/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ config {
)
.unwrap();

assert_display_snapshot!(spec, @r###"
assert_snapshot!(spec, @r###"
config {
prop "color" default="true" env="COLOR" help="Enable color output"
prop "jobs" default="4" env="JOBS" help="Number of jobs to run"
Expand Down
22 changes: 11 additions & 11 deletions src/parse/flag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,16 @@ mod tests {

#[test]
fn from_str() {
assert_display_snapshot!("-f".parse::<SpecFlag>().unwrap(), @"-f");
assert_display_snapshot!("--flag".parse::<SpecFlag>().unwrap(), @"--flag");
assert_display_snapshot!("-f --flag".parse::<SpecFlag>().unwrap(), @"-f --flag");
assert_display_snapshot!("-f --flag...".parse::<SpecFlag>().unwrap(), @"-f --flag...");
assert_display_snapshot!("-f --flag ...".parse::<SpecFlag>().unwrap(), @"-f --flag...");
assert_display_snapshot!("--flag <arg>".parse::<SpecFlag>().unwrap(), @"--flag <arg>");
assert_display_snapshot!("-f --flag <arg>".parse::<SpecFlag>().unwrap(), @"-f --flag <arg>");
assert_display_snapshot!("-f --flag... <arg>".parse::<SpecFlag>().unwrap(), @"-f --flag... <arg>");
assert_display_snapshot!("-f --flag <arg>...".parse::<SpecFlag>().unwrap(), @"-f --flag <arg>...");
assert_display_snapshot!("myflag: -f".parse::<SpecFlag>().unwrap(), @"myflag: -f");
assert_display_snapshot!("myflag: -f --flag <arg>".parse::<SpecFlag>().unwrap(), @"myflag: -f --flag <arg>");
assert_snapshot!("-f".parse::<SpecFlag>().unwrap(), @"-f");
assert_snapshot!("--flag".parse::<SpecFlag>().unwrap(), @"--flag");
assert_snapshot!("-f --flag".parse::<SpecFlag>().unwrap(), @"-f --flag");
assert_snapshot!("-f --flag...".parse::<SpecFlag>().unwrap(), @"-f --flag...");
assert_snapshot!("-f --flag ...".parse::<SpecFlag>().unwrap(), @"-f --flag...");
assert_snapshot!("--flag <arg>".parse::<SpecFlag>().unwrap(), @"--flag <arg>");
assert_snapshot!("-f --flag <arg>".parse::<SpecFlag>().unwrap(), @"-f --flag <arg>");
assert_snapshot!("-f --flag... <arg>".parse::<SpecFlag>().unwrap(), @"-f --flag... <arg>");
assert_snapshot!("-f --flag <arg>...".parse::<SpecFlag>().unwrap(), @"-f --flag <arg>...");
assert_snapshot!("myflag: -f".parse::<SpecFlag>().unwrap(), @"myflag: -f");
assert_snapshot!("myflag: -f --flag <arg>".parse::<SpecFlag>().unwrap(), @"myflag: -f --flag <arg>");
}
}
4 changes: 2 additions & 2 deletions src/parse/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ cmd "config" {
"#,
)
.unwrap();
assert_display_snapshot!(spec, @r###"
assert_snapshot!(spec, @r###"
name "Usage CLI"
bin "usage"
flag "-f --force" global=true
Expand All @@ -265,7 +265,7 @@ cmd "config" {
#[cfg(feature = "clap")]
fn test_clap() {
let cmd = clap::Command::new("test");
assert_display_snapshot!(Spec::from(&cmd), @r###"
assert_snapshot!(Spec::from(&cmd), @r###"
name "test"
bin "test"
usage "Usage: test"
Expand Down

0 comments on commit be8d6d5

Please sign in to comment.