@@ -0,0 +1,46 @@
1+{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
2+module Tests.Readers.RST (tests) where
3+
4+import Text.Pandoc.Definition
5+import Test.Framework
6+import Tests.Helpers
7+import Tests.Arbitrary()
8+import Text.Pandoc.Builder
9+import Text.Pandoc
10+
11+rst :: String -> Pandoc
12+rst = readRST defaultParserState{ stateStandalone = True }
13+
14+infix 5 =:
15+(=:) :: ToString c
16+ => String -> (String, c) -> Test
17+(=:) = test rst
18+
19+tests :: [Test]
20+tests = [ "field list" =:
21+ [_LIT|
22+:Hostname: media08
23+:IP address: 10.0.0.19
24+:Size: 3ru
25+:Date: 2001-08-16
26+:Version: 1
27+:Authors: - Me
28+ - Myself
29+ - I
30+:Indentation: Since the field marker may be quite long, the second
31+ and subsequent lines of the field body do not have to line up
32+ with the first line, but they must be indented relative to the
33+ field name marker, and they must line up with each other.
34+:Parameter i: integer
35+|] =?> ( setAuthors ["Me","Myself","I"]
36+ $ setDate "2001-08-16"
37+ $ doc
38+ $ definitionList [ (str "Hostname", [plain "media08"])
39+ , (str "IP address", [plain "10.0.0.19"])
40+ , (str "Size", [plain "3ru"])
41+ , (str "Version", [plain "1"])
42+ , (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."])
43+ , (str "Parameter i", [plain "integer"])
44+ ])
45+ ]
46+