]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - test/WikiParserTest.hs
implemented more markup stuffs
[Rakka.git] / test / WikiParserTest.hs
index 543401597cbc5b85ce733d7db72b9a2f94369188..384cc5fde51f549d9310000a98ba9ef1469bb35a 100644 (file)
@@ -151,21 +151,21 @@ testData = [ (parseWiki ""
 
            , (parseWiki " foo"
               ~?=
-              (Right [ LeadingSpaced [ Text "foo" ] ]))
+              (Right [ Preformatted [ Text "foo" ] ]))
 
            , (parseWiki " foo\n  bar\n"
               ~?=
-              (Right [ LeadingSpaced [ Text "foo"
-                                     , Text "\n"
-                                     , Text " bar"
-                                     ]
+              (Right [ Preformatted [ Text "foo"
+                                    , Text "\n"
+                                    , Text " bar"
+                                    ]
                      ]))
 
            , (parseWiki "foo\n bar\nbaz"
               ~?=
-              (Right [ Paragraph     [ Text "foo" ]
-                     , LeadingSpaced [ Text "bar" ]
-                     , Paragraph     [ Text "baz" ]
+              (Right [ Paragraph    [ Text "foo" ]
+                     , Preformatted [ Text "bar" ]
+                     , Paragraph    [ Text "baz" ]
                      ]))
 
            , (parseWiki "----"
@@ -239,4 +239,42 @@ testData = [ (parseWiki ""
                                                                 , Text "baz" ]
                                       ]
                      ]))
+
+           , (parseWiki "<![CDATA[foo [[bar]] baz]]>"
+              ~?=
+              (Right [ Paragraph [ Text "foo [[bar]] baz" ] ]))
+
+           , (parseWiki "<![PDATA[foo [[bar]] baz]]>"
+              ~?=
+              (Right [ Preformatted [ Text "foo [[bar]] baz" ] ]))
+
+           , (parseWiki "<![PDATA[\nfoo [[bar]] baz\n]]>"
+              ~?=
+              (Right [ Preformatted [ Text "foo [[bar]] baz" ] ]))
+
+           , (parseWiki "foo' bar"
+              ~?=
+              (Right [ Paragraph [ Text "foo"
+                                 , Text "'"
+                                 , Text " bar" ]
+                     ]))
+
+           , (parseWiki "''foo''"
+              ~?=
+              (Right [ Paragraph [ Italic [Text "foo"] ] ]))
+
+           , (parseWiki "'''foo'''"
+              ~?=
+              (Right [ Paragraph [ Bold [Text "foo"] ] ]))
+
+           , (parseWiki "foo''''"
+              ~?=
+              (Right [ Paragraph [ Text "foo"
+                                 , Text "'"
+                                 ]
+                     ]))
+
+           , (parseWiki "'''''foo'''''"
+              ~?=
+              (Right [ Paragraph [ Italic [Bold [Text "foo"]] ] ]))
            ]