forked from extern/nushell
Paren interpolation (#3452)
* Switch interp to use parens * improve interp parsing
This commit is contained in:
@ -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!(
|
||||
|
Reference in New Issue
Block a user