aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2021-10-14 16:16:25 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2021-10-14 13:41:12 -0700
commita41c1fe0bbdf912f3585c7eb91b59340c35b9b77 (patch)
tree9ff28eef3a00dff6a83652a7046edbe21dc9bcdf /test/Tests/Writers
parent628cde48cf54d806508869a9d6f4307efc266ef2 (diff)
downloadpandoc-a41c1fe0bbdf912f3585c7eb91b59340c35b9b77.tar.gz
asciidoc writer: translate numberLines attribute to linesnum switch
AsciiDoctor allows to request line numbering on code blocks by using a switch on the `source` block, such as in: ``` [source%linesnum,haskell] ---- some Haskell code here ---- ```
Diffstat (limited to 'test/Tests/Writers')
-rw-r--r--test/Tests/Writers/AsciiDoc.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Tests/Writers/AsciiDoc.hs b/test/Tests/Writers/AsciiDoc.hs
index 04655635f..7b2dd11e8 100644
--- a/test/Tests/Writers/AsciiDoc.hs
+++ b/test/Tests/Writers/AsciiDoc.hs
@@ -38,6 +38,22 @@ tests = [ testGroup "emphasis"
para (singleQuoted (strong (text "foo"))) =?>
"`**foo**'"
]
+ , testGroup "blocks"
+ [ testAsciidoc "code block without line numbers" $
+ codeBlockWith ("", [ "haskell" ], []) "foo" =?> unlines
+ [ "[source,haskell]"
+ , "----"
+ , "foo"
+ , "----"
+ ]
+ , testAsciidoc "code block with line numbers" $
+ codeBlockWith ("", [ "haskell", "numberLines" ], []) "foo" =?> unlines
+ [ "[source%linesnum,haskell]"
+ , "----"
+ , "foo"
+ , "----"
+ ]
+ ]
, testGroup "tables"
[ testAsciidoc "empty cells" $
simpleTable [] [[mempty],[mempty]] =?> unlines