From 6ff04ac52de07ef1de7d9ccba0d74db5aa12dda8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 06:51:21 -0700 Subject: Fix compareXML helper in Tests.Writers.OOXML. Given how it is used, we were getting "mine" and "good" flipped in the test results. --- test/Tests/Writers/OOXML.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index f2957f7a6..fea7fa70f 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -23,15 +23,15 @@ compareXML :: Content -> Content -> Maybe XMLDifference -- We make a special exception for times at the moment, and just pass -- them because we can't control the utctime when running IO. Besides, -- so long as we have two times, we're okay. -compareXML (Elem myElem) (Elem goodElem) +compareXML (Elem goodElem) (Elem myElem) | (QName "created" _ (Just "dcterms")) <- elName myElem , (QName "created" _ (Just "dcterms")) <- elName goodElem = Nothing -compareXML (Elem myElem) (Elem goodElem) +compareXML (Elem goodElem) (Elem myElem) | (QName "modified" _ (Just "dcterms")) <- elName myElem , (QName "modified" _ (Just "dcterms")) <- elName goodElem = Nothing -compareXML (Elem myElem) (Elem goodElem) = +compareXML (Elem goodElem) (Elem myElem) = (if elName myElem == elName goodElem then Nothing else Just @@ -46,16 +46,16 @@ compareXML (Elem myElem) (Elem goodElem) = , good = sort (elAttribs goodElem) }))) <|> asum (zipWith compareXML (elContent myElem) (elContent goodElem)) -compareXML (Text myCData) (Text goodCData) = +compareXML (Text goodCData) (Text myCData) = (if cdVerbatim myCData == cdVerbatim goodCData && cdData myCData == cdData goodCData then Nothing else Just (CDatasDiffer (Comparison { mine = myCData, good = goodCData }))) -compareXML (CRef myStr) (CRef goodStr) = +compareXML (CRef goodStr) (CRef myStr) = if myStr == goodStr then Nothing else Just (CRefsDiffer (Comparison { mine = myStr, good = goodStr })) -compareXML m g = Just (OtherContentsDiffer (Comparison {mine = m, good = g})) +compareXML g m = Just (OtherContentsDiffer (Comparison {mine = m, good = g})) data XMLDifference = ElemNamesDiffer (Comparison QName) -- cgit v1.2.3