diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-09-14 10:37:19 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-09-14 10:37:19 -0700 |
commit | 88a0327579438de0c7ca340b7f11e7041237b4f6 (patch) | |
tree | a56667debbe0da33c65d493a1ac444b2d2c83099 /test | |
parent | 7ecae69e27289923b4c6302c8b7dd35dc5da891f (diff) | |
download | pandoc-88a0327579438de0c7ca340b7f11e7041237b4f6.tar.gz |
FB2 reader test: Another attempt to fix test failure on GitHub CI.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Readers/FB2.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/Tests/Readers/FB2.hs b/test/Tests/Readers/FB2.hs index dd228aeae..4198b9b53 100644 --- a/test/Tests/Readers/FB2.hs +++ b/test/Tests/Readers/FB2.hs @@ -18,16 +18,17 @@ import Tests.Helpers import Test.Tasty.Golden (goldenVsString) 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 Text.Pandoc.UTF8 (toText, fromStringLazy) +import Data.Text (Text, unpack) 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 + (fromStringLazy . filter (/='\r') . unpack . fb2ToNative . toText + <$> BS.readFile path) where native = replaceExtension path ".native" tests :: [TestTree] |