diff options
Diffstat (limited to 'test/Tests/Readers/Docx.hs')
-rw-r--r-- | test/Tests/Readers/Docx.hs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index 68c2e3476..89a605bf7 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -5,6 +5,7 @@ import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as B import qualified Data.Map as M import qualified Data.Text as T +import Data.Maybe import System.IO.Unsafe import Test.Tasty import Test.Tasty.HUnit @@ -46,7 +47,7 @@ compareOutput opts docxFile nativeFile = do nf <- UTF8.toText <$> BS.readFile nativeFile p <- runIOorExplode $ readDocx opts df df' <- runIOorExplode $ readNative def nf - return $ (noNorm p, noNorm df') + return (noNorm p, noNorm df') testCompareWithOptsIO :: ReaderOptions -> String -> FilePath -> FilePath -> IO TestTree testCompareWithOptsIO opts name docxFile nativeFile = do @@ -87,11 +88,9 @@ compareMediaPathIO mediaPath mediaBag docxPath = do Nothing -> error ("couldn't find " ++ mediaPath ++ " in media bag") - docxBS = case docxMedia of - Just bs -> bs - Nothing -> error ("couldn't find " ++ - mediaPath ++ - " in media bag") + docxBS = fromMaybe (error ("couldn't find " ++ + mediaPath ++ + " in media bag")) docxMedia return $ mbBS == docxBS compareMediaBagIO :: FilePath -> IO Bool @@ -128,6 +127,10 @@ tests = [ testGroup "inlines" "docx/links.docx" "docx/links.native" , testCompare + "hyperlinks in <w:instrText> tag" + "docx/instrText_hyperlink.docx" + "docx/instrText_hyperlink.native" + , testCompare "inline image" "docx/image.docx" "docx/image_no_embed.native" |