diff options
author | René Kijewski <kijewski@library.vetmed.fu-berlin.de> | 2021-07-30 15:54:38 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2021-07-30 16:36:59 +0200 |
commit | 4123ec37a2a58248433b03765ebfb2d55155a2ae (patch) | |
tree | b79fea8a4a97b01413d97e3283041dfc02df39ee /testing/tests/ui | |
parent | 268d8250fb0a9cdcbbd760bdf39424ed02fd1920 (diff) | |
download | askama-4123ec37a2a58248433b03765ebfb2d55155a2ae.tar.gz askama-4123ec37a2a58248433b03765ebfb2d55155a2ae.tar.bz2 askama-4123ec37a2a58248433b03765ebfb2d55155a2ae.zip |
Better error messages using cuts
Diffstat (limited to 'testing/tests/ui')
-rw-r--r-- | testing/tests/ui/typo_in_keyword.rs | 11 | ||||
-rw-r--r-- | testing/tests/ui/typo_in_keyword.stderr | 8 |
2 files changed, 19 insertions, 0 deletions
diff --git a/testing/tests/ui/typo_in_keyword.rs b/testing/tests/ui/typo_in_keyword.rs new file mode 100644 index 0000000..acbf5d7 --- /dev/null +++ b/testing/tests/ui/typo_in_keyword.rs @@ -0,0 +1,11 @@ +use askama::Template; + +#[derive(Template)] +#[template( + source = "{%for i in 1..=10%}{{i}}{%endfo%}\n1234567890123456789012345678901234567890", + ext = "txt" +)] +struct MyTemplate; + +fn main() { +} diff --git a/testing/tests/ui/typo_in_keyword.stderr b/testing/tests/ui/typo_in_keyword.stderr new file mode 100644 index 0000000..545476e --- /dev/null +++ b/testing/tests/ui/typo_in_keyword.stderr @@ -0,0 +1,8 @@ +error: problems parsing template source at row 1, column 26 near: +"endfo%}\n12345678901234567890123456789012"... + --> $DIR/typo_in_keyword.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) |