diff options
author | Mike Hommey <glandium@debian.org> | 2010-03-18 07:40:32 +0100 |
---|---|---|
committer | Mike Hommey <glandium@debian.org> | 2010-03-18 07:40:32 +0100 |
commit | eb5d521a2df72fa829a7f8196b957c696e7ccc58 (patch) | |
tree | 224599e18a48f87e82aa8a32456563277c68ae58 /python/tests/xpathleak.py | |
parent | 8a10e02b2f4971d3fdacab7dc7baecced34056fb (diff) | |
download | libxml2-eb5d521a2df72fa829a7f8196b957c696e7ccc58.tar.gz |
Import upstream version 2.7.7upstream/2.7.7.dfsg
Diffstat (limited to 'python/tests/xpathleak.py')
-rw-r--r-- | python/tests/xpathleak.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/python/tests/xpathleak.py b/python/tests/xpathleak.py index dcc144c..39f49e3 100644 --- a/python/tests/xpathleak.py +++ b/python/tests/xpathleak.py @@ -15,6 +15,14 @@ expect="""--> Invalid expression --> xmlXPathEval: evaluation failed --> Invalid expression --> xmlXPathEval: evaluation failed +--> Invalid expression +--> xmlXPathEval: evaluation failed +--> Invalid expression +--> xmlXPathEval: evaluation failed +--> Invalid expression +--> xmlXPathEval: evaluation failed +--> Invalid expression +--> xmlXPathEval: evaluation failed """ err="" def callback(ctx, str): @@ -27,7 +35,11 @@ libxml2.registerErrorHandler(callback, "-->") doc = libxml2.parseDoc("<fish/>") ctxt = doc.xpathNewContext() ctxt.setContextNode(doc) -for expr in (":false()","bad:()","bad(:)",":bad(:)","bad:(:)","bad:bad(:)"): +badexprs = ( + ":false()", "bad:()", "bad(:)", ":bad(:)", "bad:(:)", "bad:bad(:)", + "a:/b", "/c:/d", "//e:/f", "g://h" + ) +for expr in badexprs: try: ctxt.xpathEval(expr) except libxml2.xpathError, e: |