mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
fix argument type (#5695)
* fix argument type * while run external, convert list argument to str * fix argument converting logic * using parse_list_expression instead of parse_full_cell_path * make parsing logic more explicit * revert changes * add tests
This commit is contained in:
@ -306,6 +306,30 @@ mod nu_commands {
|
||||
|
||||
assert_eq!(actual.out, "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn command_list_arg_test() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
nu ['-c' 'version']
|
||||
"#);
|
||||
|
||||
assert!(actual.out.contains("version"));
|
||||
assert!(actual.out.contains("rust_version"));
|
||||
assert!(actual.out.contains("rust_channel"));
|
||||
assert!(actual.out.contains("pkg_version"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn command_cell_path_arg_test() {
|
||||
let actual = nu!(cwd: ".", r#"
|
||||
nu ([ '-c' 'version' ])
|
||||
"#);
|
||||
|
||||
assert!(actual.out.contains("version"));
|
||||
assert!(actual.out.contains("rust_version"));
|
||||
assert!(actual.out.contains("rust_channel"));
|
||||
assert!(actual.out.contains("pkg_version"));
|
||||
}
|
||||
}
|
||||
|
||||
mod nu_script {
|
||||
|
Reference in New Issue
Block a user