[libxslt] Add test case for XPath function args in error case



commit 683cbc82dee4cea75822a0f7cafd97768b6165ff
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Fri Dec 20 17:39:59 2013 +0100

    Add test case for XPath function args in error case
    
    Add the test case from Jan Pokorný to the test suite. This test is known
    to fail with libxml2 2.9.1 and below but fixed in libxml2 Git.

 tests/docs/bug-184.xml    |    1 +
 tests/general/bug-184.err |    5 +++++
 tests/general/bug-184.out |    2 ++
 tests/general/bug-184.xsl |    8 ++++++++
 4 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/tests/docs/bug-184.xml b/tests/docs/bug-184.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-184.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/bug-184.err b/tests/general/bug-184.err
new file mode 100644
index 0000000..ec5e912
--- /dev/null
+++ b/tests/general/bug-184.err
@@ -0,0 +1,5 @@
+runtime error: file ./bug-184.xsl line 5 element value-of
+Variable 'nonexistent' has not been declared.
+xmlXPathCompiledEval: 1 objects left on the stack.
+runtime error: file ./bug-184.xsl line 5 element value-of
+XPath evaluation returned no result.
diff --git a/tests/general/bug-184.out b/tests/general/bug-184.out
new file mode 100644
index 0000000..e829790
--- /dev/null
+++ b/tests/general/bug-184.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result/>
diff --git a/tests/general/bug-184.xsl b/tests/general/bug-184.xsl
new file mode 100644
index 0000000..6ab9676
--- /dev/null
+++ b/tests/general/bug-184.xsl
@@ -0,0 +1,8 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+    <!-- Known to fail with libxml2 2.9.1 and below. -->
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="generate-id()=generate-id(key('none', $nonexistent))"/>
+        </result>
+    </xsl:template>
+</xsl:stylesheet>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]