@@ -8,6 +8,7 @@ import Tests.Arbitrary()
88import Text.Pandoc.Builder
99import Text.Pandoc
1010import Text.Pandoc.Error
11+import qualified Data.Sequence as Seq
1112
1213rst :: String -> Pandoc
1314rst = handleError . readRST def{ readerStandalone = True }
@@ -94,6 +95,20 @@ tests = [ "line block with blank line" =:
9495 ("A-1-B_2_C:3:D+4+E.5.F_\n\n" ++
9596 ".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\n") =?>
9697 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+ )
97112 , testGroup "literal / line / code blocks"
98113 [ "indented literal block" =: unlines
99114 [ "::"