mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 23:35:07 +00:00
Add ui test for extends
error
This commit is contained in:
parent
29687db996
commit
585a992246
18
testing/tests/ui/extends.rs
Normal file
18
testing/tests/ui/extends.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
use askama::Template;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(
|
||||||
|
source = r#"{%- extends "whatever.html" %}"#,
|
||||||
|
ext = "html"
|
||||||
|
)]
|
||||||
|
struct ExtendsPre;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(
|
||||||
|
source = r#"{% extends "whatever.html" -%}"#,
|
||||||
|
ext = "html"
|
||||||
|
)]
|
||||||
|
struct ExtendsPost;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
}
|
19
testing/tests/ui/extends.stderr
Normal file
19
testing/tests/ui/extends.stderr
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
error: whitespace control is not allowed on `extends`
|
||||||
|
problems parsing template source at row 1, column 2 near:
|
||||||
|
"- extends \"whatever.html\" %}"
|
||||||
|
--> tests/ui/extends.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)
|
||||||
|
|
||||||
|
error: whitespace control is not allowed on `extends`
|
||||||
|
problems parsing template source at row 1, column 2 near:
|
||||||
|
" extends \"whatever.html\" -%}"
|
||||||
|
--> tests/ui/extends.rs:10:10
|
||||||
|
|
|
||||||
|
10 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
Loading…
x
Reference in New Issue
Block a user