mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 08:23:24 +01:00
Fix single quote external interpolation (#4867)
This commit is contained in:
parent
d0cbb2d12c
commit
7773c4cd4d
@ -263,7 +263,11 @@ pub fn parse_external_call(
|
|||||||
let contents = working_set.get_span_contents(*span);
|
let contents = working_set.get_span_contents(*span);
|
||||||
|
|
||||||
if contents.starts_with(b"$") || contents.starts_with(b"(") {
|
if contents.starts_with(b"$") || contents.starts_with(b"(") {
|
||||||
let (arg, err) = parse_expression(working_set, &[*span], true);
|
let (arg, err) = parse_dollar_expr(working_set, *span);
|
||||||
|
error = error.or(err);
|
||||||
|
args.push(arg);
|
||||||
|
} else if contents.starts_with(b"(") {
|
||||||
|
let (arg, err) = parse_full_cell_path(working_set, None, *span);
|
||||||
error = error.or(err);
|
error = error.or(err);
|
||||||
args.push(arg);
|
args.push(arg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -83,8 +83,13 @@ fn execute_binary_in_string() {
|
|||||||
assert_eq!(actual.out, "$0");
|
assert_eq!(actual.out, "$0");
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: jt - this is blocked on https://github.com/nushell/engine-q/issues/875
|
#[test]
|
||||||
#[ignore]
|
fn single_quote_dollar_external() {
|
||||||
|
let actual = nu!(cwd: ".", r#"let author = 'JT'; ^echo $'foo=($author)'"#);
|
||||||
|
|
||||||
|
assert_eq!(actual.out, "foo=JT");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn redirects_custom_command_external() {
|
fn redirects_custom_command_external() {
|
||||||
let actual = nu!(cwd: ".", r#"def foo [] { nu --testbin cococo foo bar }; foo | str length"#);
|
let actual = nu!(cwd: ".", r#"def foo [] { nu --testbin cococo foo bar }; foo | str length"#);
|
||||||
|
Loading…
Reference in New Issue
Block a user