Skip to content

Commit

Permalink
test: add test case to reproduce #504
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed May 14, 2022
1 parent 0b34742 commit ba9d489
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/partial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,4 +542,26 @@ Template:test
hb.render("t1", &data).unwrap()
);
}

#[test]
fn test_multiline_partial() {
let mut hb = Registry::new();
hb.set_prevent_indent(false);

hb.register_template_string(
"t1",
r#"{{#*inline "thepartial"}}
inner first line
inner second line
{{/inline}}
{{> thepartial}}"#,
)
.unwrap();
assert_eq!(
r#" inner first line
inner second line
"#,
hb.render("t1", &()).unwrap()
);
}
}

0 comments on commit ba9d489

Please sign in to comment.