Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d4a5781

Browse files
Add test for filter block chaining
1 parent 97683a7 commit d4a5781

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

testing/tests/filter_block.rs

+19
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,22 @@ fn filter_block_not_html_escape() {
128128
let template = E;
129129
assert_eq!(template.render().unwrap(), r#"<block>"#);
130130
}
131+
132+
// This test checks that the filter chaining is working as expected.
133+
#[derive(Template)]
134+
#[template(
135+
source = r#"{% filter lower|indent(2)|capitalize -%}
136+
HELLO
137+
{{u}}
138+
{%- endfilter %}"#,
139+
ext = "txt"
140+
)]
141+
struct F {
142+
u: &'static str,
143+
}
144+
145+
#[test]
146+
fn filter_block_chaining() {
147+
let template = F { u: "yOU" };
148+
assert_eq!(template.render().unwrap(), "Hello\n you");
149+
}

0 commit comments

Comments
 (0)