diff options
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] |