aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests/Readers
diff options
context:
space:
mode:
authorEmanuel Evans <mail@emanuel.industries>2016-04-24 21:58:53 -0700
committerEmanuel Evans <mail@emanuel.industries>2016-04-26 10:29:59 -0700
commit1bfe39e24cb58c361a05f419ef9a4a5263f558f6 (patch)
tree8ad6987956b848c0be1470eea36140bc6d28fb0b /tests/Tests/Readers
parenta0fae92847207493eff5a2d2a5ac3b483ed00087 (diff)
downloadpandoc-1bfe39e24cb58c361a05f419ef9a4a5263f558f6.tar.gz
Ignore leading space in org code blocks
Fixes #2862 Also fix up tab handling for leading whitespace in code blocks.
Diffstat (limited to 'tests/Tests/Readers')
-rw-r--r--tests/Tests/Readers/Org.hs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index b095ac60a..bb9b37d13 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -1054,6 +1054,33 @@ tests =
" where greeting = \"moin\"\n"
in codeBlockWith attr' code'
+ , "Source block with indented code" =:
+ unlines [ " #+BEGIN_SRC haskell"
+ , " main = putStrLn greeting"
+ , " where greeting = \"moin\""
+ , " #+END_SRC" ] =?>
+ let attr' = ("", ["haskell"], [])
+ code' = "main = putStrLn greeting\n" ++
+ " where greeting = \"moin\"\n"
+ in codeBlockWith attr' code'
+
+ , "Source block with tab-indented code" =:
+ unlines [ "\t#+BEGIN_SRC haskell"
+ , "\tmain = putStrLn greeting"
+ , "\t where greeting = \"moin\""
+ , "\t#+END_SRC" ] =?>
+ let attr' = ("", ["haskell"], [])
+ code' = "main = putStrLn greeting\n" ++
+ " where greeting = \"moin\"\n"
+ in codeBlockWith attr' code'
+
+ , "Empty source block" =:
+ unlines [ " #+BEGIN_SRC haskell"
+ , " #+END_SRC" ] =?>
+ let attr' = ("", ["haskell"], [])
+ code' = ""
+ in codeBlockWith attr' code'
+
, "Source block between paragraphs" =:
unlines [ "Low German greeting"
, " #+BEGIN_SRC haskell"