Skip to content

Commit

Permalink
add tests for markdown headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hayd committed Jan 31, 2015
1 parent 5974145 commit da1242b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/markdown.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import Base: writemime
@test md"foo" == MD(Paragraph("foo"))
@test md"foo *bar* baz" == MD(Paragraph(["foo ", Italic("bar"), " baz"]))

@test md"#title" == Markdown.MD(Markdown.Header{1}("title"))
@test md"## section" == Markdown.MD(Markdown.Header{2}("section"))
@test md"# title *foo* `bar` **baz**" == Markdown.MD(Markdown.Header{1}(["title ",
Markdown.Italic("foo")," ",Markdown.Code("bar")," ",Markdown.Bold("baz")]))

@test md"**foo *bar* baz**" == MD(Paragraph(Bold(["foo ", Italic("bar"), " baz"])))
# @test md"**foo *bar* baz**" == MD(Paragraph(Italic(["foo ", Bold("bar"), " baz"])))

Expand All @@ -20,10 +25,15 @@ import Base: writemime

@test md"foo" |> plain == "foo\n"
@test md"foo *bar* baz" |> plain == "foo *bar* baz\n"
@test md"#title" |> plain == "# title\n"
@test md"## section" |> plain == "## section\n"
@test md"## section `foo`" |> plain == "## section `foo`\n"

# HTML output

@test md"foo *bar* baz" |> html == "<p>foo <em>bar</em> baz</p>\n"
@test md"# title *blah*" |> html == "<h1>title <em>blah</em></h1>\n"
@test md"## title *blah*" |> html == "<h2>title <em>blah</em></h2>\n"

# Interpolation / Custom types

Expand Down

0 comments on commit da1242b

Please sign in to comment.