X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=tests%2FWikiParserTest.hs;h=a7c5c70087ecf9c41918ac06fdd847f94e4829d0;hb=b4c0033f297c28d95ad9298b489126331224bc42;hp=4b47e26c58052d5bcb4b50409c36757658bd7ede;hpb=b3c3f333cd48bc74eb33f0f21d56a9d1bc65e0ea;p=Rakka.git diff --git a/tests/WikiParserTest.hs b/tests/WikiParserTest.hs index 4b47e26..a7c5c70 100644 --- a/tests/WikiParserTest.hs +++ b/tests/WikiParserTest.hs @@ -119,6 +119,14 @@ testData = [ (parseWiki "" ~?= (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 ] @@ -198,44 +206,44 @@ testData = [ (parseWiki "" , (parseWiki "* a" ~?= - (Right [ List (ListElement Bullet [[Right (Text "a")]]) ])) + (Right [ List Bullet [[Inline (Text "a")]] ])) , (parseWiki "* a*" ~?= - (Right [ List (ListElement Bullet [[Right (Text "a*")]]) ])) + (Right [ List Bullet [[Inline (Text "a*")]] ])) , (parseWiki "* a\n* b\n" ~?= - (Right [ List (ListElement Bullet [ [Right (Text "a")] - , [Right (Text "b")] - ]) + (Right [ List Bullet [ [Inline (Text "a")] + , [Inline (Text "b")] + ] ])) , (parseWiki "*a\n*#b\n*#c\n" ~?= - (Right [ List (ListElement Bullet [ [ Right (Text "a") - , Left (ListElement Numbered [ [Right (Text "b")] - , [Right (Text "c")] - ]) - ] - ]) + (Right [ List Bullet [ [ Inline (Text "a") + , Block (List Numbered [ [Inline (Text "b")] + , [Inline (Text "c")] + ]) + ] + ] ])) , (parseWiki "*a\n#b" ~?= - (Right [ List (ListElement Bullet [ [Right (Text "a")] ]) - , List (ListElement Numbered [ [Right (Text "b")] ]) + (Right [ List Bullet [ [Inline (Text "a")] ] + , List Numbered [ [Inline (Text "b")] ] ])) , (parseWiki "*a" ~?= - (Right [ List (ListElement Bullet [ [Right (Text "a")] ]) ])) + (Right [ List Bullet [ [Inline (Text "a")] ] ])) , (parseWiki "*a\n*b" ~?= - (Right [ List (ListElement Bullet [ [Right (Text "a")] - , [Right (Text "b")] - ]) + (Right [ List Bullet [ [Inline (Text "a")] + , [Inline (Text "b")] + ] ])) , (parseWiki "foo:bar" @@ -262,15 +270,15 @@ testData = [ (parseWiki "" ] ])) - , (parseWiki "" + , (parseWiki "" ~?= (Right [ Paragraph [ Text "foo [[bar]] baz" ] ])) - , (parseWiki "" + , (parseWiki "" ~?= (Right [ Preformatted [ Text "foo [[bar]] baz" ] ])) - , (parseWiki "" + , (parseWiki "" ~?= (Right [ Preformatted [ Text "foo [[bar]] baz" ] ]))