Add test for imports
This commit is contained in:
parent
54cfd04c53
commit
f382dcb03b
19
src/lib.rs
19
src/lib.rs
|
@ -88,6 +88,25 @@ mod tests {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn import_parse() {
|
||||||
|
let mut parser = MarkdownTeraRewriter::new();
|
||||||
|
let mut buf = Vec::new();
|
||||||
|
|
||||||
|
parser
|
||||||
|
.parse(
|
||||||
|
"test.html",
|
||||||
|
b"<p>{% extends \"base.html\" %}\n{% import \"macros.html\" %}\n{% block content %}</p>\n<div><p>hi :3</p></div>{% endblock content %}",
|
||||||
|
&mut buf,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
"{% extends \"base.html\" %}\n{% import \"macros.html\" %}\n{% block content %}\n<div><p>hi :3</p></div>{% endblock content %}",
|
||||||
|
String::from_utf8_lossy(&buf)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn preformatter() {
|
fn preformatter() {
|
||||||
let mut parser = MarkdownTeraPreformatter::new();
|
let mut parser = MarkdownTeraPreformatter::new();
|
||||||
|
|
Loading…
Reference in a new issue