summaryrefslogtreecommitdiff
path: root/src/Tests/Readers/RST.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-29 11:24:16 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-29 11:24:16 -0800
commit570d8ff08c7007c4fffd345c9bf2057201a0bdd4 (patch)
tree1e420ee65bbde87c52b714449622c5ef2adcd194 /src/Tests/Readers/RST.hs
parentfbf166b6c30a752047c7f49c20313421e3465009 (diff)
Moved tests to src.
Diffstat (limited to 'src/Tests/Readers/RST.hs')
-rw-r--r--src/Tests/Readers/RST.hs46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/Tests/Readers/RST.hs b/src/Tests/Readers/RST.hs
new file mode 100644
index 000000000..c0f60ff51
--- /dev/null
+++ b/src/Tests/Readers/RST.hs
@@ -0,0 +1,46 @@
+{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
+module Tests.Readers.RST (tests) where
+
+import Text.Pandoc.Definition
+import Test.Framework
+import Tests.Helpers
+import Tests.Arbitrary()
+import Text.Pandoc.Builder
+import Text.Pandoc
+
+rst :: String -> Pandoc
+rst = readRST defaultParserState{ stateStandalone = True }
+
+infix 5 =:
+(=:) :: ToString c
+ => String -> (String, c) -> Test
+(=:) = test rst
+
+tests :: [Test]
+tests = [ "field list" =:
+ [_LIT|
+:Hostname: media08
+:IP address: 10.0.0.19
+:Size: 3ru
+:Date: 2001-08-16
+:Version: 1
+:Authors: - Me
+ - Myself
+ - I
+:Indentation: Since the field marker may be quite long, the second
+ and subsequent lines of the field body do not have to line up
+ with the first line, but they must be indented relative to the
+ field name marker, and they must line up with each other.
+:Parameter i: integer
+|] =?> ( setAuthors ["Me","Myself","I"]
+ $ setDate "2001-08-16"
+ $ doc
+ $ definitionList [ (str "Hostname", [para "media08"])
+ , (str "IP address", [para "10.0.0.19"])
+ , (str "Size", [para "3ru"])
+ , (str "Version", [para "1"])
+ , (str "Indentation", [para "Since the field marker may be quite long, the second and subsequent lines of the field body do not have to line up with the first line, but they must be indented relative to the field name marker, and they must line up with each other."])
+ , (str "Parameter i", [para "integer"])
+ ])
+ ]
+