OOXML tests: use pretty-printed form to display diffs.

Otherwise everything is on one line and the diff is uninformative.
This commit is contained in:
John MacFarlane 2021-10-02 07:03:22 -07:00
parent 82d587493d
commit 11baeb8850

View file

@ -68,10 +68,10 @@ data XMLDifference
data Comparison a = Comparison { good :: a, mine :: a }
deriving (Show)
displayDiff :: Content -> Content -> String
displayDiff :: Element -> Element -> String
displayDiff elemA elemB =
showDiff (1,1)
(getDiff (lines $ showContent elemA) (lines $ showContent elemB))
(getDiff (lines $ ppElement elemA) (lines $ ppElement elemB))
goldenArchive :: FilePath -> IO Archive
goldenArchive fp = toArchive . BL.fromStrict <$> BS.readFile fp
@ -137,7 +137,7 @@ compareXMLFile' fp goldenArch testArch = do
display difference = "Non-matching xml in "
++ fp ++ ":\n"
++ "* " ++ show difference ++ "\n"
++ displayDiff testContent goldenContent
++ displayDiff testXMLDoc goldenXMLDoc
maybe (Right ()) (Left . display) (compareXML goldenContent testContent)