Skip to content

Commit

Permalink
Improve test_markdown_owned_string test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilkuu-2 committed Jan 9, 2024
1 parent 20976e2 commit 9109d48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions testing/tests/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,17 @@ after",
}

#[derive(Template)]
#[template(source = "{{content|markdown}}", ext = "html", print="code")]
#[template(source = "{{content|markdown}}", ext = "html")]
struct MarkdownStringTemplate{
pub content: String
}

// Tests if the markdown filter accepts String
#[test]
fn test_markdown_owned_string() {
let template = MarkdownStringTemplate {content: "Show basic _functionality_ of __Markdown__".into()};
let template = MarkdownStringTemplate {content: "The markdown filter _indeed_ works with __String__".into()};
assert_eq!(
template.render().unwrap(),
"<p>Show basic <em>functionality</em> of <strong>Markdown</strong></p>\n"
"<p>The markdown filter <em>indeed</em> works with <strong>String</strong></p>\n"
)
}

0 comments on commit 9109d48

Please sign in to comment.