Fix raw strings as external argument (#12817)

# Description
As discovered by @YizhePKU in a
[comment](https://github.com/nushell/nushell/pull/9956#issuecomment-2103123797)
in #9956, raw strings are not parsed properly when they are used as an
argument to an external command. This PR fixes that.

# Tests + Formatting
Added a test.
This commit is contained in:
Ian Manske
2024-05-09 23:50:31 +00:00
committed by GitHub
parent 72d3860d05
commit 70c01bbb26
3 changed files with 32 additions and 1 deletions

View File

@ -314,6 +314,7 @@ mod external_words {
use super::nu;
use nu_test_support::fs::Stub::FileWithContent;
use nu_test_support::{pipeline, playground::Playground};
#[test]
fn relaxed_external_words() {
let actual = nu!("
@ -323,6 +324,12 @@ mod external_words {
assert_eq!(actual.out, "joturner@foo.bar.baz");
}
#[test]
fn raw_string_as_external_argument() {
let actual = nu!("nu --testbin cococo r#'asdf'#");
assert_eq!(actual.out, "asdf");
}
//FIXME: jt: limitation in testing - can't use single ticks currently
#[ignore]
#[test]