diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-09-13 16:50:00 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-09-13 16:50:00 -0700 |
commit | e35147d715a737bb854e0c527243f77d970d1b86 (patch) | |
tree | 390558c23b272a097d8061902589997e7c06beec /test/Tests | |
parent | b59e6d03762becd5c9d767463ce7ba5062a1b4a0 (diff) | |
download | pandoc-e35147d715a737bb854e0c527243f77d970d1b86.tar.gz |
FB2 reader test: filter CRs.
This may help with the test failure on GitHub CI.
https://github.com/jgm/pandoc/commit/b59e6d03762becd5c9d767463ce7ba5062a1b4a0/checks
Diffstat (limited to 'test/Tests')
-rw-r--r-- | test/Tests/Readers/FB2.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Tests/Readers/FB2.hs b/test/Tests/Readers/FB2.hs index dd228aeae..3cc28bdbd 100644 --- a/test/Tests/Readers/FB2.hs +++ b/test/Tests/Readers/FB2.hs @@ -20,14 +20,14 @@ import qualified Data.ByteString as BS import Text.Pandoc import Text.Pandoc.UTF8 (toText, fromTextLazy) import Data.Text (Text) -import Data.Text.Lazy (fromStrict) +import qualified Data.Text.Lazy as TL import System.FilePath (replaceExtension) fb2ToNative :: Text -> Text fb2ToNative = purely (writeNative def{ writerTemplate = Just mempty }) . purely (readFB2 def) fb2Test :: TestName -> FilePath -> TestTree -fb2Test name path = goldenVsString name native (fromTextLazy . fromStrict . fb2ToNative . toText <$> BS.readFile path) +fb2Test name path = goldenVsString name native (fromTextLazy . TL.filter (/= '\r') . TL.fromStrict . fb2ToNative . toText <$> BS.readFile path) where native = replaceExtension path ".native" tests :: [TestTree] |