Skip to content

Commit

Permalink
Add "json: too many args" ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Jun 24, 2024
1 parent 462c04c commit f7710a9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 10 additions & 0 deletions testing/tests/ui/json-too-many-args.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions testing/tests/ui/json-too-many-args.stderr
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit f7710a9

Please sign in to comment.