diff options
author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-10-25 11:11:00 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-10-25 14:54:14 +0200 |
commit | 77d5d28b20162c522483ed009afba2ca9a6ee390 (patch) | |
tree | 691832d38eaf67840e4a77653520d0b3d322a563 /testing/tests | |
parent | d48ac76f0a6561cc16aa650f0f33a3d1f9e809b9 (diff) | |
download | askama-77d5d28b20162c522483ed009afba2ca9a6ee390.tar.gz askama-77d5d28b20162c522483ed009afba2ca9a6ee390.tar.bz2 askama-77d5d28b20162c522483ed009afba2ca9a6ee390.zip |
Add UI test for `elif` error message
Diffstat (limited to 'testing/tests')
-rw-r--r-- | testing/tests/ui/elif.rs | 8 | ||||
-rw-r--r-- | testing/tests/ui/elif.stderr | 9 |
2 files changed, 17 insertions, 0 deletions
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) |