aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-14 10:37:19 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-14 10:37:19 -0700
commit88a0327579438de0c7ca340b7f11e7041237b4f6 (patch)
treea56667debbe0da33c65d493a1ac444b2d2c83099 /test
parent7ecae69e27289923b4c6302c8b7dd35dc5da891f (diff)
downloadpandoc-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.hs9
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]