Skip to content

Commit

Permalink
Add UI test for elif error message
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and djc committed Oct 25, 2023
1 parent d48ac76 commit 77d5d28
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testing/tests/ui/elif.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use askama::Template;

#[derive(Template)]
#[template(source = "{% if true %}{% elif false %}{% endif %}", ext = "html")]
struct UnknownElif;

fn main() {
}
9 changes: 9 additions & 0 deletions testing/tests/ui/elif.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error: unknown `elif` keyword; did you mean `else if`?
problems parsing template source at row 1, column 16 near:
"elif false %}{% endif %}"
--> tests/ui/elif.rs:3:10
|
3 | #[derive(Template)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 77d5d28

Please sign in to comment.