Update format string tests to explicitly escape multiple newlines

From what I can tell, the goal of the tests is to ensure that the error
formatting is correct.  I think this is still being tested as intended
after this change.
This commit is contained in:
Anton Golov 2021-07-31 23:09:19 +02:00
parent a03fbfe2ff
commit 2dff700c4f
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ fn main() {
a"); a");
//~^ ERROR invalid format string //~^ ERROR invalid format string
format!("{ \ format!("{ \
\
b"); b");
//~^ ERROR invalid format string //~^ ERROR invalid format string
format!(r#"{ \ format!(r#"{ \
@ -38,12 +38,12 @@ fn main() {
{ \ { \
\ \
b \ b \
\
"); ");
//~^^^ ERROR invalid format string //~^^^ ERROR invalid format string
format!(r#" format!(r#"
raw { \ raw { \
\
c"#); c"#);
//~^^^ ERROR invalid format string //~^^^ ERROR invalid format string
format!(r#" format!(r#"

View File

@ -19,7 +19,7 @@ error: invalid format string: expected `'}'`, found `'b'`
| |
LL | format!("{ \ LL | format!("{ \
| - because of this opening brace | - because of this opening brace
LL | LL | \
LL | b"); LL | b");
| ^ expected `}` in format string | ^ expected `}` in format string
| |