Add unclosed node ui tests

This commit is contained in:
René Kijewski 2024-05-17 16:07:44 +02:00 committed by René Kijewski
parent c83cd4a71b
commit a03a06c338
2 changed files with 158 additions and 0 deletions

View 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() {}

View 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)