From 77d5d28b20162c522483ed009afba2ca9a6ee390 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 25 Oct 2023 11:11:00 +0200 Subject: Add UI test for `elif` error message --- testing/tests/ui/elif.rs | 8 ++++++++ testing/tests/ui/elif.stderr | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 testing/tests/ui/elif.rs create mode 100644 testing/tests/ui/elif.stderr diff --git a/testing/tests/ui/elif.rs b/testing/tests/ui/elif.rs new file mode 100644 index 0000000..650f292 --- /dev/null +++ b/testing/tests/ui/elif.rs @@ -0,0 +1,8 @@ +use askama::Template; + +#[derive(Template)] +#[template(source = "{% if true %}{% elif false %}{% endif %}", ext = "html")] +struct UnknownElif; + +fn main() { +} diff --git a/testing/tests/ui/elif.stderr b/testing/tests/ui/elif.stderr new file mode 100644 index 0000000..0d5de47 --- /dev/null +++ b/testing/tests/ui/elif.stderr @@ -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) -- cgit