hexpat 0.19.2 → 0.19.3
raw patch · 4 files changed
+35/−7 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- cbits/xmlparse.c +9/−0
- hexpat.cabal +9/−4
- test/hexpat-tests.cabal +2/−0
- test/suite/Text/XML/Expat/UnitTests.hs +15/−3
cbits/xmlparse.c view
@@ -73,6 +73,15 @@ /* Round up n to be a multiple of sz, where sz is a power of 2. */ #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) +/* Handle the case where memmove() doesn't exist. */+#ifndef HAVE_MEMMOVE+#ifdef HAVE_BCOPY+#define memmove(d,s,l) bcopy((s),(d),(l))+#else+#error memmove does not exist on this platform, nor is a substitute available+#endif /* HAVE_BCOPY */+#endif /* HAVE_MEMMOVE */+ #include "internal.h" #include "xmltok.h" #include "xmlrole.h"
hexpat.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: >= 1.6 Name: hexpat-Version: 0.19.2+Version: 0.19.3 Synopsis: XML parser/formatter based on expat Description: This package provides a general purpose Haskell XML library using Expat to@@ -48,7 +48,8 @@ items more than once (inefficient in chunked processing); 0.19 add Extended.hs; 0.19.1 fix a memory leak introduced in 0.19, delegate parsing to bound thread if unbound (see note above); 0.19.2 include expat source code so \'cabal install\' just works- on Linux, Mac and Windows.+ on Linux, Mac and Windows (thanks Jacob Stanley); 0.19.3 fix misconfiguration of expat+ which broke entity parsing. Category: XML License: BSD3 License-File: LICENSE@@ -58,7 +59,8 @@ Gregory Collins, Evan Martin (who started the project), Matthew Pocock [drdozer],- Kevin Jardine+ Kevin Jardine,+ Jacob Stanley Maintainer: http://blacksapphire.com/antispam/ Copyright: (c) 2009 Doug Beardsley <mightybyte@gmail.com>,@@ -67,7 +69,8 @@ (c) 2008 Evan Martin <martine@danga.com>, (c) 2009 Matthew Pocock <matthew.pocock@ncl.ac.uk>, (c) 2007-2009 Galois Inc.,- (c) 2010 Kevin Jardine+ (c) 2010 Kevin Jardine,+ (c) 2010 Jacob Stanley Homepage: http://haskell.org/haskellwiki/Hexpat/ Extra-Source-Files: test/hexpat-tests.cabal,@@ -146,3 +149,5 @@ cbits/xmltok.c, cbits/xmltok_impl.c, cbits/xmltok_ns.c+ cc-options: -DHAVE_MEMMOVE -DXML_NS -DXML_DTD+
test/hexpat-tests.cabal view
@@ -38,3 +38,5 @@ ../cbits/xmltok.c, ../cbits/xmltok_impl.c, ../cbits/xmltok_ns.c+ cc-options: -DHAVE_MEMMOVE -DXML_NS -DXML_DTD+
test/suite/Text/XML/Expat/UnitTests.hs view
@@ -8,6 +8,7 @@ import Text.XML.Expat.Format import Text.XML.Expat.Qualified import qualified Data.ByteString as B+import qualified Data.ByteString.Lazy.Char8 as LC import qualified Data.ByteString.Lazy as L import qualified Data.Text as T import CForeign@@ -93,7 +94,7 @@ test_error4 :: IO () test_error4 = do let eDoc = Tree.parse' defaultParseOptions (toByteString "!") :: Either XMLParseError (UNode String)- assertEqual "error1" (Left $ XMLParseError "unclosed token"+ assertEqual "error1" (Left $ XMLParseError "not well-formed (invalid token)" (XMLParseLocation 1 0 0 0)) eDoc test_parse :: IO ()@@ -120,7 +121,7 @@ l -test_entities = do+test_entities1 = do assertEqual "parse error" merr Nothing assertEqual "entity substitution" (Text "foo") c where@@ -136,6 +137,16 @@ then Just "foo" else Nothing +test_entities2 = do+ assertEqual "wrong answer" (Element "html" [] [Text "\228"], Nothing) pr+ where+ pr :: (UNode String, Maybe XMLParseError)+ pr = Tree.parse opt $ LC.pack "<html>ä</html>"+ where+ opt = defaultParseOptions+ { entityDecoder = Just ed }+ ed "auml" = Just "\228"+ ed _ = Nothing test_textContent = do let tree = Element "cheese" [("type", "edam")]@@ -265,7 +276,8 @@ TestLabel "error3" $ TestCase $ test_error3, TestLabel "error4" $ TestCase $ test_error4, TestLabel "parse" $ TestCase $ test_parse,- TestLabel "entities" $ TestCase $ test_entities,+ TestLabel "entities1" $ TestCase $ test_entities1,+ TestLabel "entities2" $ TestCase $ test_entities2, TestLabel "textContent" $ TestCase $ test_textContent, TestLabel "indent" $ TestCase $ test_indent, TestLabel "setAttribute" $ TestCase $ test_setAttribute