add testcase for environment variables

This commit is contained in:
Nguyen Duc Toan 2023-09-28 18:25:42 +07:00 committed by sxyazi
parent 608ec97b17
commit 88a68fb1ec
No known key found for this signature in database

View file

@ -214,5 +214,11 @@ mod cmdparse {
let args = parse_cmd_to_args("echo -C%* xyz", &["111", "222"]);
assert_eq!(args, vec!["echo", "-C111 222", "xyz"]);
}
#[test]
fn test_env_var() {
let args = parse_cmd_to_args(" %EDITOR% %* xyz", &["111", "222"]);
assert_eq!(args, vec!["%EDITOR%", "111", "222", "xyz"]);
}
}
}