mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
@@ -20,14 +20,14 @@ import qualified Data.ByteString as BS
|
||||
import Text.Pandoc
|
||||
import Text.Pandoc.UTF8 (toText, fromTextLazy)
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text.Lazy as TL
|
||||
import Data.Text.Lazy (fromStrict)
|
||||
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 . TL.filter (/= '\r') . TL.fromStrict . fb2ToNative . toText <$> BS.readFile path)
|
||||
fb2Test name path = goldenVsString name native (fromTextLazy . fromStrict . fb2ToNative . toText <$> BS.readFile path)
|
||||
where native = replaceExtension path ".native"
|
||||
|
||||
tests :: [TestTree]
|
||||
|
||||
Reference in New Issue
Block a user