From ce43dea594a1465755997235ab163aaca47fad52 Mon Sep 17 00:00:00 2001 From: Matti Pastell Date: Mon, 8 Jan 2018 12:53:48 +0200 Subject: [PATCH] Add tests for markdown writer --- test/markdown_test.jl | 72 +++++++++++++++++++++++++++++++++++++++++++ test/runtests.jl | 1 + 2 files changed, 73 insertions(+) create mode 100644 test/markdown_test.jl diff --git a/test/markdown_test.jl b/test/markdown_test.jl new file mode 100644 index 0000000..f07bbd1 --- /dev/null +++ b/test/markdown_test.jl @@ -0,0 +1,72 @@ +using Base.Test +import Weave: Markdown2HTML + +# Test markdown2html writer + +html = Markdown2HTML.html(Markdown.parse(""" + +# H1 + +## H2 + +## H3 + + +Some **text** with different [^note] *formatting* and \$math\$ and text. + +`some code` with [link](http://github.com) + +[^note]: test note + +--- + +\$more math\$ + +* List one +* List two + +1. List one +2. List two + +```julia +x = 3 +``` + +!!! note "Something" + + Test admonition with ![Image](link/to/image.png) + +> Some important quote + +""")) + +ref_html = """

H1

+

H2

+

H3

+

Some text with different [note] formatting and \$math\$ and text.

+

some code with link

+

note

test note

+
+
+

\\[more math\\]

+ +
    +
  1. List one

    +
  2. +
  3. List two

    +
  4. +
+
x = 3 
+

Something

Test admonition with \"Image\"

+
+
+

Some important quote

+
+""" + +@test html == ref_html diff --git a/test/runtests.jl b/test/runtests.jl index b72e851..9267f3d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -12,6 +12,7 @@ include("convert_test.jl") info("Testing formatters") include("formatter_test.jl") +include("markdown_test.jl") info("Testing figure formatters") include("figureformatter_test.jl")