Fixes . expanded incorrectly as external argument (#12950)

This PR fixes a bug where `.` is expanded into an empty string when used
as an argument to external commands. Fixes
https://github.com/nushell/nushell/issues/12948.

---------

Co-authored-by: Ian Manske <ian.manske@pm.me>
This commit is contained in:
YizhePKU
2024-05-26 07:06:17 +08:00
committed by GitHub
parent 0c5a67f4e5
commit f38f88d42c
2 changed files with 21 additions and 1 deletions

View File

@ -61,6 +61,13 @@ fn automatically_change_directory_with_trailing_slash_and_same_name_as_command()
})
}
#[test]
fn pass_dot_as_external_arguments() {
let actual = nu!("nu --testbin cococo .");
assert_eq!(actual.out, ".");
}
#[test]
fn correctly_escape_external_arguments() {
let actual = nu!("^nu --testbin cococo '$0'");