aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/tests/ui.rs7
-rw-r--r--testing/tests/ui/incorrect_path.rs8
-rw-r--r--testing/tests/ui/incorrect_path.stderr7
3 files changed, 22 insertions, 0 deletions
diff --git a/testing/tests/ui.rs b/testing/tests/ui.rs
new file mode 100644
index 0000000..17c2248
--- /dev/null
+++ b/testing/tests/ui.rs
@@ -0,0 +1,7 @@
+use trybuild::TestCases;
+
+#[cfg_attr(not(windows), test)]
+fn ui() {
+ let t = TestCases::new();
+ t.compile_fail("tests/ui/*.rs");
+}
diff --git a/testing/tests/ui/incorrect_path.rs b/testing/tests/ui/incorrect_path.rs
new file mode 100644
index 0000000..f0c85cf
--- /dev/null
+++ b/testing/tests/ui/incorrect_path.rs
@@ -0,0 +1,8 @@
+use askama::Template;
+
+#[derive(Template)]
+#[template(path = "thisdoesnotexist.html")]
+struct MyTemplate;
+
+fn main() {
+}
diff --git a/testing/tests/ui/incorrect_path.stderr b/testing/tests/ui/incorrect_path.stderr
new file mode 100644
index 0000000..ea97149
--- /dev/null
+++ b/testing/tests/ui/incorrect_path.stderr
@@ -0,0 +1,7 @@
+error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/askama_testing/templates"]
+ --> $DIR/incorrect_path.rs:3:10
+ |
+3 | #[derive(Template)]
+ | ^^^^^^^^
+ |
+ = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)