mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-02 15:25:19 +00:00
Add unclosed node ui tests
This commit is contained in:
parent
c83cd4a71b
commit
a03a06c338
51
testing/tests/ui/unclosed-nodes.rs
Normal file
51
testing/tests/ui/unclosed-nodes.rs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
use askama::Template;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{{ expr", ext = "txt")]
|
||||||
|
struct Expr1;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{{ expr ", ext = "txt")]
|
||||||
|
struct Expr2;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{{ expr -", ext = "txt")]
|
||||||
|
struct Expr3;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{{ expr -}", ext = "txt")]
|
||||||
|
struct Expr4;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{% let x", ext = "txt")]
|
||||||
|
struct Node1;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{% let x ", ext = "txt")]
|
||||||
|
struct Node2;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{% let x -", ext = "txt")]
|
||||||
|
struct Node3;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{% let x -%", ext = "txt")]
|
||||||
|
struct Node4;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{# comment", ext = "txt")]
|
||||||
|
struct Comment1;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{# comment ", ext = "txt")]
|
||||||
|
struct Comment2;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{# comment -", ext = "txt")]
|
||||||
|
struct Comment3;
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(source = "{# comment -#", ext = "txt")]
|
||||||
|
struct Comment4;
|
||||||
|
|
||||||
|
fn main() {}
|
107
testing/tests/ui/unclosed-nodes.stderr
Normal file
107
testing/tests/ui/unclosed-nodes.stderr
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
error: failed to parse template source at row 1, column 7 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.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: failed to parse template source at row 1, column 8 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:7:10
|
||||||
|
|
|
||||||
|
7 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 9 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:11:10
|
||||||
|
|
|
||||||
|
11 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 9 near:
|
||||||
|
"}"
|
||||||
|
--> tests/ui/unclosed-nodes.rs:15:10
|
||||||
|
|
|
||||||
|
15 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 8 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:19:10
|
||||||
|
|
|
||||||
|
19 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 9 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:23:10
|
||||||
|
|
|
||||||
|
23 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 10 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:27:10
|
||||||
|
|
|
||||||
|
27 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 10 near:
|
||||||
|
"%"
|
||||||
|
--> tests/ui/unclosed-nodes.rs:31:10
|
||||||
|
|
|
||||||
|
31 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 10 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:35:10
|
||||||
|
|
|
||||||
|
35 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 11 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:39:10
|
||||||
|
|
|
||||||
|
39 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 12 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:43:10
|
||||||
|
|
|
||||||
|
43 | #[derive(Template)]
|
||||||
|
| ^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error: failed to parse template source at row 1, column 13 near:
|
||||||
|
""
|
||||||
|
--> tests/ui/unclosed-nodes.rs:47:10
|
||||||
|
|
|
||||||
|
47 | #[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