fix: Properly parse Expressions, Idents, and Literals
This commit is contained in:
@@ -109,7 +109,7 @@ fn match_statement(#[case] match_arg: TestArgs, #[case] expected: &str) {
|
||||
#[case(None, None, r#""echo" "test""#)]
|
||||
#[case(Some("arg"), None, r#""echo" "test" "arg""#)]
|
||||
#[case(None, Some("arg"), r#""echo" "test" "multi" "arg""#)]
|
||||
#[case(Some("1"), Some("2"), r#""echo" "test" "1" "multi" "2""#)]
|
||||
#[case(Some("1"), Some("2"), r#""echo" "test" "1" "multi=2""#)]
|
||||
fn multi_match(#[case] single: Option<&str>, #[case] multi: Option<&str>, #[case] expected: &str) {
|
||||
let command = cmd!(
|
||||
"echo",
|
||||
@@ -118,7 +118,7 @@ fn multi_match(#[case] single: Option<&str>, #[case] multi: Option<&str>, #[case
|
||||
(None, None) => [],
|
||||
(Some(single), None) => single,
|
||||
(None, Some(multi)) => ["multi", multi],
|
||||
(Some(single), Some(multi)) => [single, "multi", multi],
|
||||
(Some(single), Some(multi)) => [single, format!("multi={multi}")],
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user