mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-30 22:41:13 +00:00
Add "json: too many args" ui test
This commit is contained in:
parent
462c04c0a0
commit
f7710a94d6
@ -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"
|
||||
|
||||
|
10
testing/tests/ui/json-too-many-args.rs
Normal file
10
testing/tests/ui/json-too-many-args.rs
Normal 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() {
|
||||
}
|
9
testing/tests/ui/json-too-many-args.stderr
Normal file
9
testing/tests/ui/json-too-many-args.stderr
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user