chore: use some raw strings to reduce quoting

This commit is contained in:
Michael Bolin
2026-01-22 22:21:07 -08:00
parent f815fa14ea
commit 02edb0419b

View File

@@ -265,17 +265,20 @@ mod tests {
#[test]
fn accepts_mixed_quote_concatenation() {
let cmds = parse_seq("echo \"/usr\"'/'\"local\"/bin").unwrap();
assert_eq!(
cmds,
parse_seq(r#"echo "/usr"'/'"local"/bin"#).unwrap(),
vec![vec!["echo".to_string(), "/usr/local/bin".to_string()]]
);
assert_eq!(
parse_seq(r#"echo '/usr'"/"'local'/bin"#).unwrap(),
vec![vec!["echo".to_string(), "/usr/local/bin".to_string()]]
);
}
#[test]
fn rejects_double_quoted_strings_with_expansions() {
assert!(parse_seq("echo \"hi ${USER}\"").is_none());
assert!(parse_seq("echo \"$HOME\"").is_none());
assert!(parse_seq(r#"echo "hi ${USER}""#).is_none());
assert!(parse_seq(r#"echo "$HOME""#).is_none());
}
#[test]