From 16ed5061ad1eb29f2f1cff90617c96353d8fd892 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Sun, 23 Mar 2025 11:57:23 +0000 Subject: [PATCH] Fix doctest on GHC 9.12 --- xml-conduit/src/Text/XML/Stream/Parse.hs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/xml-conduit/src/Text/XML/Stream/Parse.hs b/xml-conduit/src/Text/XML/Stream/Parse.hs index 2a376cd..27d313f 100644 --- a/xml-conduit/src/Text/XML/Stream/Parse.hs +++ b/xml-conduit/src/Text/XML/Stream/Parse.hs @@ -1301,9 +1301,19 @@ takeContent = do -- -- If an opening-tag is consumed but no matching closing-tag is found, an 'XmlException' is thrown. -- --- >>> runConduit $ parseLBS def "" .| void (takeTree "a" ignoreAttrs) .| sinkList --- *** Exception: InvalidEndElement (Name {nameLocalName = "a", nameNamespace = Nothing, namePrefix = Nothing}) Nothing --- +{- +>>> runConduit $ parseLBS def "" .| void (takeTree "a" ignoreAttrs) .| sinkList +#if MIN_VERSION_base(4, 21, 0) +*** Exception: Error while parsing XML event: expected , got nothing + +^ +HasCallStack backtrace: + throwIO, called at libraries/exceptions/src/Control/Monad/Catch.hs:308:12 in exceptions-0.10.9-inplace:Control.Monad.Catch + throwM, called at /home/alexfmpe/profiles/alexfmpe/repos/xml/xml-conduit/src/Text/XML/Stream/Parse.hs:1324:71 in main:Text.XML.Stream.Parse +#else +*** Exception: InvalidEndElement (Name {nameLocalName = "a", nameNamespace = Nothing, namePrefix = Nothing}) Nothing +#endif +-} -- This function automatically ignores comments, instructions and whitespace. -- -- Returns @Just ()@ if an element was consumed, 'Nothing' otherwise.