Add tests for automatically slugged links

This commit is contained in:
Magnus Hovland Hoff 2018-10-03 22:35:47 +02:00
parent 575c18f915
commit cffcc93b15

View file

@ -41,3 +41,22 @@ pub fn render_markdown_for_fts(src: &str) -> String {
buf
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn slug_link() {
let actual = render_markdown("[Slug link]");
let expected = "<p><a href=\"slug-link\" title=\"Slug link\">Slug link</a></p>\n";
assert_eq!(actual, expected);
}
#[test]
fn footnote_links() {
let actual = render_markdown("[Link]\n\n[Link]: target");
let expected = "<p><a href=\"target\">Link</a></p>\n";
assert_eq!(actual, expected);
}
}