From 11baeb88505342c580cc3dd0263c4ba97e6ddb8a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 07:03:22 -0700 Subject: OOXML tests: use pretty-printed form to display diffs. Otherwise everything is on one line and the diff is uninformative. --- test/Tests/Writers/OOXML.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index fea7fa70f..43543954c 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -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) -- cgit v1.2.3