git.iko.soy/typeable/pandoc
on master help sign in
FB2 reader test: Another attempt to fix test failure on GitHub CI.
commit88a0327579438de0c7ca340b7f11e7041237b4f6 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 14 Sep 2019, 10:37 (7 years ago) parent7ecae69
1 file changed+5−4
test/Tests/Readers/FB2.hs+5−4
test/Tests/Readers/FB2.hs+5−4
@@ -18,16 +18,17 @@ import Tests.Helpers
1818import Test.Tasty.Golden (goldenVsString)
1919import qualified Data.ByteString as BS
2020import Text.Pandoc
21−import Text.Pandoc.UTF8 (toText, fromTextLazy)
22−import Data.Text (Text)
23−import Data.Text.Lazy (fromStrict)
21+import Text.Pandoc.UTF8 (toText, fromStringLazy)
22+import Data.Text (Text, unpack)
2423import System.FilePath (replaceExtension)
2524
2625fb2ToNative :: Text -> Text
2726fb2ToNative = purely (writeNative def{ writerTemplate = Just mempty }) . purely (readFB2 def)
2827
2928fb2Test :: TestName -> FilePath -> TestTree
30−fb2Test name path = goldenVsString name native (fromTextLazy . fromStrict . fb2ToNative . toText <$> BS.readFile path)
29+fb2Test name path = goldenVsString name native
30+ (fromStringLazy . filter (/='\r') . unpack . fb2ToNative . toText
31+ <$> BS.readFile path)
3132 where native = replaceExtension path ".native"
3233
3334tests :: [TestTree]