summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSidharth Kapur <sidharthkapur1@gmail.com>2016-05-01 22:23:33 -0500
committerSidharth Kapur <sidharthkapur1@gmail.com>2016-05-01 22:23:33 -0500
commit72d1900b30d20e369df5f4201e224e8edf314386 (patch)
tree1c2e20131d9ff8fc1eafee137c37c61511bc05b5
parent490c2b543d51603663178c99aea88c1a1fdd2838 (diff)
Add test for RST code directive class
-rw-r--r--tests/Tests/Readers/RST.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs
index ea85a5929..8fa2e4828 100644
--- a/tests/Tests/Readers/RST.hs
+++ b/tests/Tests/Readers/RST.hs
@@ -8,6 +8,7 @@ import Tests.Arbitrary()
import Text.Pandoc.Builder
import Text.Pandoc
import Text.Pandoc.Error
+import qualified Data.Sequence as Seq
rst :: String -> Pandoc
rst = handleError . readRST def{ readerStandalone = True }
@@ -94,6 +95,20 @@ tests = [ "line block with blank line" =:
("A-1-B_2_C:3:D+4+E.5.F_\n\n" ++
".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\n") =?>
para (link "https://example.com" "" "A-1-B_2_C:3:D+4+E.5.F")
+ , "Code directive with class and number-lines" =: unlines
+ [ ".. code::python"
+ , " :number-lines: 34"
+ , " :class: class1 class2 class3"
+ , ""
+ , " def func(x):"
+ , " return y"
+ ] =?>
+ ( doc . Many . Seq.singleton $
+ CodeBlock ( ""
+ , ["sourceCode", "python", "numberLines", "class1", "class2", "class3"]
+ , [ ("startFrom", "34") ]
+ ) "def func(x):\n return y"
+ )
, testGroup "literal / line / code blocks"
[ "indented literal block" =: unlines
[ "::"