aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Readers/Org
diff options
context:
space:
mode:
authordespresc <christian.j.j.despres@gmail.com>2019-11-04 16:12:37 -0500
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-12 16:03:45 -0800
commit90e436d49604e3fd1ef9432fb23f6d7f6245c7fd (patch)
tree4e7f0692f989643189f1fc6786050d95e239a0ea /test/Tests/Readers/Org
parentd3966372f5049eea56213b069fc4d70d8af9144c (diff)
downloadpandoc-90e436d49604e3fd1ef9432fb23f6d7f6245c7fd.tar.gz
Switch to new pandoc-types and use Text instead of String [API change].
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
Diffstat (limited to 'test/Tests/Readers/Org')
-rw-r--r--test/Tests/Readers/Org/Block.hs2
-rw-r--r--test/Tests/Readers/Org/Block/CodeBlock.hs16
-rw-r--r--test/Tests/Readers/Org/Shared.hs3
3 files changed, 11 insertions, 10 deletions
diff --git a/test/Tests/Readers/Org/Block.hs b/test/Tests/Readers/Org/Block.hs
index 35fd4c1fa..8cf9a0e56 100644
--- a/test/Tests/Readers/Org/Block.hs
+++ b/test/Tests/Readers/Org/Block.hs
@@ -179,7 +179,7 @@ tests =
, "\\end{equation}"
] =?>
rawBlock "latex"
- (unlines [ "\\begin{equation}"
+ (T.unlines [ "\\begin{equation}"
, "X_i = \\begin{cases}"
, " G_{\\alpha(i)} & \\text{if }\\alpha(i-1) =" <>
" \\alpha(i)\\\\"
diff --git a/test/Tests/Readers/Org/Block/CodeBlock.hs b/test/Tests/Readers/Org/Block/CodeBlock.hs
index 7f50a1c81..01c89642e 100644
--- a/test/Tests/Readers/Org/Block/CodeBlock.hs
+++ b/test/Tests/Readers/Org/Block/CodeBlock.hs
@@ -80,7 +80,7 @@ tests =
params = [ ("org-language", "emacs-lisp")
, ("exports", "both")
]
- code' = unlines [ "(progn (message \"Hello, World!\")"
+ code' = T.unlines [ "(progn (message \"Hello, World!\")"
, " (+ 23 42))" ]
in codeBlockWith ("", classes, params) code'
@@ -96,8 +96,8 @@ tests =
params = [ ("org-language", "emacs-lisp")
, ("exports", "both")
]
- code' = unlines [ "(progn (message \"Hello, World!\")"
- , " (+ 23 42))" ]
+ code' = T.unlines [ "(progn (message \"Hello, World!\")"
+ , " (+ 23 42))" ]
results' = "65\n"
in codeBlockWith ("", classes, params) code'
<>
@@ -115,8 +115,8 @@ tests =
params = [ ("org-language", "emacs-lisp")
, ("exports", "code")
]
- code' = unlines [ "(progn (message \"Hello, World!\")"
- , " (+ 23 42))" ]
+ code' = T.unlines [ "(progn (message \"Hello, World!\")"
+ , " (+ 23 42))" ]
in codeBlockWith ("", classes, params) code'
, "Source block with results and :exports results" =:
@@ -190,9 +190,9 @@ tests =
(plain $ spanWith ("", ["label"], [])
(spcSep [ "Functor", "laws", "in", "Haskell" ]))
(codeBlockWith ("functor-laws", ["haskell"], [])
- (unlines [ "fmap id = id"
- , "fmap (p . q) = (fmap p) . (fmap q)"
- ])))
+ (T.unlines [ "fmap id = id"
+ , "fmap (p . q) = (fmap p) . (fmap q)"
+ ])))
, "Non-letter chars in source block parameters" =:
T.unlines [ "#+BEGIN_SRC C :tangle xxxx.c :city Zürich"
diff --git a/test/Tests/Readers/Org/Shared.hs b/test/Tests/Readers/Org/Shared.hs
index f26442621..aa253aa36 100644
--- a/test/Tests/Readers/Org/Shared.hs
+++ b/test/Tests/Readers/Org/Shared.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE OverloadedStrings #-}
{- |
Module : Tests.Readers.Org.Shared
Copyright : © 2014-2019 Albert Krewinkel
@@ -38,5 +39,5 @@ spcSep :: [Inlines] -> Inlines
spcSep = mconcat . intersperse space
-- | Create a span for the given tag.
-tagSpan :: String -> Inlines
+tagSpan :: Text -> Inlines
tagSpan t = spanWith ("", ["tag"], [("tag-name", t)]) . smallcaps $ str t