Add UI regression tests for cyclic dependencies

This commit is contained in:
Guillaume Gomez 2024-04-11 20:23:37 +02:00
parent 1899765230
commit 7f6beca8a8
6 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1 @@
{% extends "cycle1.html" %}

View File

@ -0,0 +1 @@
{% extends "cycle2.html" %}

View File

@ -0,0 +1,8 @@
use askama::Template;
#[derive(Template)]
#[template(path = "cycle2.html")]
struct Cycle;
fn main() {
}

View File

@ -0,0 +1,9 @@
error: cyclic dependency in graph [
"\"$WORKSPACE/target/tests/trybuild/askama_testing/templates/cycle2.html/" --> \"$WORKSPACE/target/tests/trybuild/askama_testing/templates/cycle2.html/"",
]
--> tests/ui/cycle.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)

View File

@ -0,0 +1,8 @@
use askama::Template;
#[derive(Template)]
#[template(path = "cycle1.html")]
struct Cycle;
fn main() {
}

View File

@ -0,0 +1,9 @@
error: cyclic dependency in graph [
"\"$WORKSPACE/target/tests/trybuild/askama_testing/templates/cycle1.html/" --> \"$WORKSPACE/target/tests/trybuild/askama_testing/templates/cycle1.html/"",
]
--> tests/ui/cycle2.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)