Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkkrp committed Oct 13, 2017
1 parent b88ef1f commit e83a0fc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/Text/MMark/ExtensionSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import qualified Text.MMark as MMark
import qualified Text.MMark.Extension as Ext

spec :: Spec
spec = do
spec = parallel $ do
describe "blockTrans" $
it "works" $ do
doc <- mkDoc "# My heading"
Expand Down
52 changes: 51 additions & 1 deletion tests/Text/MMarkSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import qualified Text.MMark.Extension as Ext

spec :: Spec
spec = parallel $ do
describe "parse and render" $
describe "parse and render" $ do
context "2.2 Tabs" $ do
it "CM1" $
"\tfoo\tbaz\t\tbim" ==->
Expand Down Expand Up @@ -49,6 +49,56 @@ spec = parallel $ do
"#\tFoo" ==-> "<h1>Foo</h1>\n"
it "CM11" $
"*\t*\t*\t" ==-> "<hr>\n"
context "3.1 Precedence" $
xit "CM12" $ -- FIXME pending lists
"- `one\n- two`" ==->
"<ul>\n<li>`one</li>\n<li>two`</li>\n</ul>\n"
context "4.1 Thematic breaks" $ do
it "CM13" $
"***\n---\n___" ==-> "<hr>\n<hr>\n<hr>\n"
it "CM14" $
"+++" ==-> "<p>+++</p>\n"
it "CM15" $
"===" ==-> "<p>===</p>\n"
xit "CM16" $ -- FIXME better parse errors (inlines)
"--\n**\n__" ==-> "<p>--\n**\n__</p>\n"
it "CM17" $
" ***\n ***\n ***" ==-> "<hr>\n<hr>\n<hr>\n"
it "CM18" $
" ***" ==-> "<pre><code>***\n</code></pre>\n"
xit "CM19" $ -- FIXME better parse errors (inlines)
"Foo\n ***" ==-> "<p>Foo\n***</p>\n"
it "CM20" $
"_____________________________________" ==->
"<hr>\n"
it "CM21" $
" - - -" ==-> "<hr>\n"
it "CM22" $
" ** * ** * ** * **" ==-> "<hr>\n"
it "CM23" $
"- - - -" ==-> "<hr>\n"
it "CM24" $
"- - - - " ==-> "<hr>\n"
xit "CM25" $ -- FIXME better parse errors (inlines)
"_ _ _ _ a\n\na------\n\n---a---" ==->
"<p>_ _ _ _ a</p>\n<p>a------</p>\n<p>---a---</p>\n"
it "CM26" $
" *-*" ==-> "<p><em>-</em></p>\n"
xit "CM27" $ -- FIXME peding lists
"- foo\n***\n- bar" ==->
"<ul>\n<li>foo</li>\n</ul>\n<hr />\n<ul>\n<li>bar</li>\n</ul>\n"
it "CM28" $
"Foo\n***\nbar" ==->
"<p>Foo</p>\n<hr>\n<p>bar</p>\n"
xit "CM29" $ -- FIXME pending setext headings
"Foo\n---\nbar" ==->
"<h2>Foo</h2>\n<p>bar</p>\n"
xit "CM30" $ -- FIXME pending lists
"* Foo\n* * *\n* Bar" ==->
"<ul>\n<li>Foo</li>\n</ul>\n<hr />\n<ul>\n<li>Bar</li>\n</ul>\n"
xit "CM31" $ -- FIXME pending lists
"- Foo\n- * * *" ==->
"<ul>\n<li>Foo</li>\n<li>\n<hr />\n</li>\n</ul>\n"
describe "useExtension" $
it "applies given extension" $ do
doc <- mkDoc "Here we go."
Expand Down

0 comments on commit e83a0fc

Please sign in to comment.