Skip to content

Commit

Permalink
added more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iganev committed Dec 28, 2023
1 parent e18a5ed commit e96ef8d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,5 +376,13 @@ mod tests {
r#"<One/>, <Two/>, <Three/>, <Four/>"#,
"Failed to concat literal, array and object using block template"
);
assert_eq!(
h.render_template(
r#"{{#concat s arr obj separator=", " distinct=true render_all=true quotes=true}}[{{#if label}}{{label}}{{else}}{{this}}{{/if}}]{{/concat}}"#,
&json!({"s": "One", "arr": ["One", "Two"], "obj": {"key0":{"label":"Two"},"key1":{"label":"Three"},"key2":{"label":"Four"}}})
).expect("Render error"),
r#""[One]", "[Two]", "[Three]", "[Four]""#,
"Failed to concat literal, array and object using block template"
);
}
}

0 comments on commit e96ef8d

Please sign in to comment.