]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - tests/WikiParserTest.hs
wrote many
[Rakka.git] / tests / WikiParserTest.hs
index 9bfdc4efa4538e8342169c1c903fba99e15184f2..4b47e26c58052d5bcb4b50409c36757658bd7ede 100644 (file)
@@ -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")
+                                 ]
+                     ]))
            ]