Add "json: too many args" ui test

This commit is contained in:
René Kijewski 2024-06-25 00:42:28 +02:00
parent 462c04c0a0
commit f7710a94d6
3 changed files with 20 additions and 0 deletions

View File

@ -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"

View File

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

View File

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