X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=tests%2FWikiParserTest.hs;h=4b47e26c58052d5bcb4b50409c36757658bd7ede;hb=b3c3f333cd48bc74eb33f0f21d56a9d1bc65e0ea;hp=9bfdc4efa4538e8342169c1c903fba99e15184f2;hpb=dcfffa578c5dd6647a5be7d2074488a520dfcf2d;p=Rakka.git diff --git a/tests/WikiParserTest.hs b/tests/WikiParserTest.hs index 9bfdc4e..4b47e26 100644 --- a/tests/WikiParserTest.hs +++ b/tests/WikiParserTest.hs @@ -3,6 +3,8 @@ module WikiParserTest ) where +import Data.Maybe +import Network.URI import Rakka.Wiki import Rakka.Wiki.Parser import Test.HUnit @@ -340,4 +342,16 @@ testData = [ (parseWiki "" (Right [ Paragraph [Text "foo"] , BlockCmd (BlockCommand "div" [("id", "bar")] []) ])) + + , (parseWiki "[http://example.org/]" + ~?= + (Right [ Paragraph [ExternalLink (fromJust $ parseURI "http://example.org/") Nothing] ])) + + , (parseWiki "[http://example.org/ example.org]" + ~?= + (Right [ Paragraph [ExternalLink + (fromJust $ parseURI "http://example.org/") + (Just "example.org") + ] + ])) ]