)
where
+import Data.Maybe
+import Network.URI
import Rakka.Wiki
import Rakka.Wiki.Parser
import Test.HUnit
~?=
(Right []))
+ , (parseWiki "[[[Page]]]"
+ ~?=
+ (Right [ Paragraph [ ObjectLink "Page" Nothing ] ]))
+
+ , (parseWiki "[[[Page|foo]]]"
+ ~?=
+ (Right [ Paragraph [ ObjectLink "Page" (Just "foo") ] ]))
+
, (parseWiki "[[Page]]"
~?=
(Right [ Paragraph [ PageLink (Just "Page") Nothing Nothing ]
(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")
+ ]
+ ]))
]