Update some string interpolation tests

This commit is contained in:
Richard Feldman 2024-01-29 06:44:41 -05:00
parent 0681929d6d
commit cc7b9def5e
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -1419,7 +1419,7 @@ fn interpolation_with_nested_strings() {
expect_success(
indoc!(
r#"
"foo \(Str.joinWith ["a", "b", "c"] ", ") bar"
"foo $(Str.joinWith ["a", "b", "c"] ", ") bar"
"#
),
r#""foo a, b, c bar" : Str"#,
@ -1431,7 +1431,7 @@ fn interpolation_with_num_to_str() {
expect_success(
indoc!(
r#"
"foo \(Num.toStr Num.maxI8) bar"
"foo $(Num.toStr Num.maxI8) bar"
"#
),
r#""foo 127 bar" : Str"#,
@ -1443,7 +1443,7 @@ fn interpolation_with_operator_desugaring() {
expect_success(
indoc!(
r#"
"foo \(Num.toStr (1 + 2)) bar"
"foo $(Num.toStr (1 + 2)) bar"
"#
),
r#""foo 3 bar" : Str"#,
@ -1458,7 +1458,7 @@ fn interpolation_with_nested_interpolation() {
expect_failure(
indoc!(
r#"
"foo \(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")"
"foo $(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")"
"#
),
indoc!(
@ -1467,7 +1467,7 @@ fn interpolation_with_nested_interpolation() {
This string interpolation is invalid:
4 "foo \(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")"
4 "foo $(Str.joinWith ["a\(Num.toStr 5)", "b"] "c")"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
String interpolations cannot contain newlines or other interpolations.