Skip to content

Commit

Permalink
Add test for raw string
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jul 23, 2018
1 parent c55a698 commit bde2be0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/test/ui/ifmt-bad-arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,11 @@ fn main() {
format!("foo }"); //~ ERROR: unmatched `}` found

format!("foo %s baz", "bar"); //~ ERROR: argument never used

format!(r##"
{foo}
"##);
//~^^^ ERROR: there is no argument named `foo`
}
8 changes: 7 additions & 1 deletion src/test/ui/ifmt-bad-arg.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,11 @@ LL | format!("foo %s baz", "bar"); //~ ERROR: argument never used
= help: `%s` should be written as `{}`
= note: printf formatting not supported; see the documentation for `std::fmt`

error: aborting due to 26 previous errors
error: there is no argument named `foo`
--> $DIR/ifmt-bad-arg.rs:70:9
|
LL | {foo}
| ^^^^^

error: aborting due to 27 previous errors

0 comments on commit bde2be0

Please sign in to comment.