summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-05-12 00:03:14 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2016-05-12 00:03:14 -0700
commit344412cba83b0f2ecbc74f2805be6da4f3d2d24b (patch)
tree1a21d6300fe1502eb698cbcd4e1fb1508595f1fe /tests
parent609fb33302156348fa3f2fc6d86b9201fa17f052 (diff)
parentff489a59f4158a95fb01d1164b5fd2b865586e73 (diff)
Merge pull request #2894 from sid-kap/rst-code-class
Add class option for code block in RST reader
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/RST.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs
index ea85a5929..622f5e48b 100644
--- a/tests/Tests/Readers/RST.hs
+++ b/tests/Tests/Readers/RST.hs
@@ -94,6 +94,35 @@ 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 $ codeBlockWith
+ ( ""
+ , ["sourceCode", "python", "numberLines", "class1", "class2", "class3"]
+ , [ ("startFrom", "34") ]
+ )
+ "def func(x):\n return y"
+ )
+ , "Code directive with number-lines, no line specified" =: unlines
+ [ ".. code::python"
+ , " :number-lines: "
+ , ""
+ , " def func(x):"
+ , " return y"
+ ] =?>
+ ( doc $ codeBlockWith
+ ( ""
+ , ["sourceCode", "python", "numberLines"]
+ , [ ("startFrom", "") ]
+ )
+ "def func(x):\n return y"
+ )
, testGroup "literal / line / code blocks"
[ "indented literal block" =: unlines
[ "::"