Skip to content

Commit

Permalink
test: add test case for trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Dec 19, 2023
1 parent 9d7d555 commit 58a32b6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/escape.rs
Expand Up @@ -106,3 +106,17 @@ fn test_triple_bracket_expression_471() {
.unwrap()
);
}

#[test]
fn test_trimmed_nonescaped_variable() {
let mut handlebars = Handlebars::new();
handlebars
.register_partial("system", "system: {{~{system}~}}")
.unwrap();

let output = handlebars
.render_template("{{>system system=\"hello\" prompt=\" world\"}}", &())
.unwrap();

assert_eq!(output, "system:hello");
}

0 comments on commit 58a32b6

Please sign in to comment.