Paren interpolation (#3452)

* Switch interp to use parens

* improve interp parsing
This commit is contained in:
JT
2021-05-21 10:55:38 +12:00
committed by GitHub
parent 722f191e82
commit 4fdbf30308
4 changed files with 43 additions and 13 deletions

View File

@ -118,7 +118,7 @@ fn string_interpolation_with_it() {
let actual = nu!(
cwd: ".",
r#"
echo "foo" | each { echo $"{$it}" }
echo "foo" | each { echo $"($it)" }
"#
);
@ -130,7 +130,7 @@ fn string_interpolation_with_it_column_path() {
let actual = nu!(
cwd: ".",
r#"
echo [[name]; [sammie]] | each { echo $"{$it.name}" }
echo [[name]; [sammie]] | each { echo $"($it.name)" }
"#
);
@ -142,13 +142,25 @@ fn string_interpolation_shorthand_overlap() {
let actual = nu!(
cwd: ".",
r#"
$"3 + 4 = {3 + 4}"
$"3 + 4 = (3 + 4)"
"#
);
assert_eq!(actual.out, "3 + 4 = 7");
}
#[test]
fn string_interpolation_and_paren() {
let actual = nu!(
cwd: ".",
r#"
$"a paren is ('(')"
"#
);
assert_eq!(actual.out, "a paren is (");
}
#[test]
fn bignum_large_integer() {
let actual = nu!(