diff --git a/testing/Cargo.toml b/testing/Cargo.toml index 7fcfff9c..76f8ca24 100644 --- a/testing/Cargo.toml +++ b/testing/Cargo.toml @@ -17,6 +17,7 @@ phf = { version = "0.11", features = ["macros" ]} serde_json = { version = "1.0", optional = true } [dev-dependencies] +rinja = { path = "../rinja", version = "0.13", features = ["serde_json"] } criterion = "0.5" trybuild = "1.0.76" diff --git a/testing/tests/ui/json-too-many-args.rs b/testing/tests/ui/json-too-many-args.rs new file mode 100644 index 00000000..a58bfce5 --- /dev/null +++ b/testing/tests/ui/json-too-many-args.rs @@ -0,0 +1,10 @@ +#![cfg(feature = "serde_json")] + +use rinja::Template; + +#[derive(Template)] +#[template(ext = "txt", source = "{{ 1|json(2, 3) }}")] +struct OneTwoThree; + +fn main() { +} diff --git a/testing/tests/ui/json-too-many-args.stderr b/testing/tests/ui/json-too-many-args.stderr new file mode 100644 index 00000000..6ecd1c41 --- /dev/null +++ b/testing/tests/ui/json-too-many-args.stderr @@ -0,0 +1,9 @@ +error: unexpected argument(s) in `json` filter + --> OneTwoThree.txt:1:3 + "1|json(2, 3) }}" + --> tests/ui/json-too-many-args.rs:5:10 + | +5 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)