aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/tests/ui/duplicated_template_attribute.rs15
-rw-r--r--testing/tests/ui/duplicated_template_attribute.stderr7
-rw-r--r--testing/tests/ui/no_template_attribute.rs7
-rw-r--r--testing/tests/ui/no_template_attribute.stderr7
4 files changed, 36 insertions, 0 deletions
diff --git a/testing/tests/ui/duplicated_template_attribute.rs b/testing/tests/ui/duplicated_template_attribute.rs
new file mode 100644
index 0000000..c0cd3e6
--- /dev/null
+++ b/testing/tests/ui/duplicated_template_attribute.rs
@@ -0,0 +1,15 @@
+use askama::Template;
+
+#[derive(Template)]
+#[template(
+ source = "🙂",
+ ext = "txt"
+)]
+#[template(
+ source = "🙃",
+ ext = "txt"
+)]
+struct TwoEmojis;
+
+fn main() {
+}
diff --git a/testing/tests/ui/duplicated_template_attribute.stderr b/testing/tests/ui/duplicated_template_attribute.stderr
new file mode 100644
index 0000000..4e6828c
--- /dev/null
+++ b/testing/tests/ui/duplicated_template_attribute.stderr
@@ -0,0 +1,7 @@
+error: duplicated 'template' attribute
+ --> tests/ui/duplicated_template_attribute.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)
diff --git a/testing/tests/ui/no_template_attribute.rs b/testing/tests/ui/no_template_attribute.rs
new file mode 100644
index 0000000..d369434
--- /dev/null
+++ b/testing/tests/ui/no_template_attribute.rs
@@ -0,0 +1,7 @@
+use askama::Template;
+
+#[derive(Template)]
+struct NoTemplate;
+
+fn main() {
+}
diff --git a/testing/tests/ui/no_template_attribute.stderr b/testing/tests/ui/no_template_attribute.stderr
new file mode 100644
index 0000000..d45d7ce
--- /dev/null
+++ b/testing/tests/ui/no_template_attribute.stderr
@@ -0,0 +1,7 @@
+error: no attribute 'template' found
+ --> tests/ui/no_template_attribute.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)