aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-10-02 06:51:21 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-10-02 06:52:40 -0700
commit6ff04ac52de07ef1de7d9ccba0d74db5aa12dda8 (patch)
tree9a09d4b80a5756407edaa6c736999c16d8473d9d /test
parentfb0d6c7cb63a791fa72becf21ed493282e65ea91 (diff)
downloadpandoc-6ff04ac52de07ef1de7d9ccba0d74db5aa12dda8.tar.gz
Fix compareXML helper in Tests.Writers.OOXML.
Given how it is used, we were getting "mine" and "good" flipped in the test results.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Writers/OOXML.hs12
1 files changed, 6 insertions, 6 deletions
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)