From cffcc93b15c1f3f15ea4b765eb6f04544c370e82 Mon Sep 17 00:00:00 2001 From: Magnus Hovland Hoff Date: Wed, 3 Oct 2018 22:35:47 +0200 Subject: [PATCH] Add tests for automatically slugged links --- src/rendering.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/rendering.rs b/src/rendering.rs index 2e39a14..400e320 100644 --- a/src/rendering.rs +++ b/src/rendering.rs @@ -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 = "

Slug link

\n"; + assert_eq!(actual, expected); + } + + #[test] + fn footnote_links() { + let actual = render_markdown("[Link]\n\n[Link]: target"); + let expected = "

Link

\n"; + assert_eq!(actual, expected); + } +}