Skip to content

Commit 73ce670

Browse files
alexfmpek0ral
authored andcommitted
Fix doctest on GHC 9.12
1 parent 8211da4 commit 73ce670

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

xml-conduit/src/Text/XML/Stream/Parse.hs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,9 +1301,19 @@ takeContent = do
13011301
--
13021302
-- If an opening-tag is consumed but no matching closing-tag is found, an 'XmlException' is thrown.
13031303
--
1304-
-- >>> runConduit $ parseLBS def "<a><b></b>" .| void (takeTree "a" ignoreAttrs) .| sinkList
1305-
-- *** Exception: InvalidEndElement (Name {nameLocalName = "a", nameNamespace = Nothing, namePrefix = Nothing}) Nothing
1306-
--
1304+
{-
1305+
>>> runConduit $ parseLBS def "<a><b></b>" .| void (takeTree "a" ignoreAttrs) .| sinkList
1306+
#if MIN_VERSION_base(4, 21, 0)
1307+
*** Exception: Error while parsing XML event: expected </Name {nameLocalName = "a", nameNamespace = Nothing, namePrefix = Nothing}>, got nothing
1308+
1309+
^
1310+
HasCallStack backtrace:
1311+
throwIO, called at libraries/exceptions/src/Control/Monad/Catch.hs:308:12 in exceptions-0.10.9-inplace:Control.Monad.Catch
1312+
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
1313+
#else
1314+
*** Exception: InvalidEndElement (Name {nameLocalName = "a", nameNamespace = Nothing, namePrefix = Nothing}) Nothing
1315+
#endif
1316+
-}
13071317
-- This function automatically ignores comments, instructions and whitespace.
13081318
--
13091319
-- Returns @Just ()@ if an element was consumed, 'Nothing' otherwise.

0 commit comments

Comments
 (0)