git.iko.soy/typeable/pandoc
on master help sign in
Add test for RST code directive class
72d1900Sidharth Kapur
tests/Tests/Readers/RST.hs+15
@@ -8,6 +8,7 @@ import Tests.Arbitrary()
8import Text.Pandoc.Builder
8import Text.Pandoc.Builder
9import Text.Pandoc
9import Text.Pandoc
10import Text.Pandoc.Error
10import Text.Pandoc.Error
11+import qualified Data.Sequence as Seq
11
12
12rst :: String -> Pandoc
13rst :: String -> Pandoc
13rst = handleError . readRST def{ readerStandalone = True }
14rst = handleError . readRST def{ readerStandalone = True }
@@ -94,6 +95,20 @@ tests = [ "line block with blank line" =:
94 ("A-1-B_2_C:3:D+4+E.5.F_\n\n" ++
95 ("A-1-B_2_C:3:D+4+E.5.F_\n\n" ++
95 ".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\n") =?>
96 ".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\n") =?>
96 para (link "https://example.com" "" "A-1-B_2_C:3:D+4+E.5.F")
97 para (link "https://example.com" "" "A-1-B_2_C:3:D+4+E.5.F")
98+ , "Code directive with class and number-lines" =: unlines
99+ [ ".. code::python"
100+ , " :number-lines: 34"
101+ , " :class: class1 class2 class3"
102+ , ""
103+ , " def func(x):"
104+ , " return y"
105+ ] =?>
106+ ( doc . Many . Seq.singleton $
107+ CodeBlock ( ""
108+ , ["sourceCode", "python", "numberLines", "class1", "class2", "class3"]
109+ , [ ("startFrom", "34") ]
110+ ) "def func(x):\n return y"
111+ )
97 , testGroup "literal / line / code blocks"
112 , testGroup "literal / line / code blocks"
98 [ "indented literal block" =: unlines
113 [ "indented literal block" =: unlines
99 [ "::"
114 [ "::"