[libxslt] Add xsl:attribute-set regression tests



commit b14acdfb9478d5cbdb95873e5410e6f6f4b7e56e
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Apr 19 13:26:55 2016 +0200

    Add xsl:attribute-set regression tests

 tests/docs/bug-188.xml        |    1 +
 tests/docs/bug-189.xml        |    1 +
 tests/docs/bug-190.xml        |    1 +
 tests/docs/bug-191.xml        |    1 +
 tests/general/bug-188-imp.xsl |    8 ++++++++
 tests/general/bug-188.out     |    4 ++++
 tests/general/bug-188.xsl     |   20 ++++++++++++++++++++
 tests/general/bug-189.out     |    5 +++++
 tests/general/bug-189.xsl     |   25 +++++++++++++++++++++++++
 tests/general/bug-190-imp.xsl |   10 ++++++++++
 tests/general/bug-190.out     |    4 ++++
 tests/general/bug-190.xsl     |   16 ++++++++++++++++
 tests/general/bug-191-imp.xsl |    8 ++++++++
 tests/general/bug-191.err     |    2 ++
 tests/general/bug-191.xsl     |    9 +++++++++
 15 files changed, 115 insertions(+), 0 deletions(-)
---
diff --git a/tests/docs/bug-188.xml b/tests/docs/bug-188.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-188.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/docs/bug-189.xml b/tests/docs/bug-189.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-189.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/docs/bug-190.xml b/tests/docs/bug-190.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-190.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/docs/bug-191.xml b/tests/docs/bug-191.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-191.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/bug-188-imp.out b/tests/general/bug-188-imp.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/general/bug-188-imp.xsl b/tests/general/bug-188-imp.xsl
new file mode 100644
index 0000000..cd87a29
--- /dev/null
+++ b/tests/general/bug-188-imp.xsl
@@ -0,0 +1,8 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+  <xsl:attribute-set name="set">
+    <xsl:attribute name="attr">BAD</xsl:attribute>
+    <xsl:attribute name="other">BAD</xsl:attribute>
+  </xsl:attribute-set>
+
+</xsl:stylesheet>
diff --git a/tests/general/bug-188.out b/tests/general/bug-188.out
new file mode 100644
index 0000000..8d87de8
--- /dev/null
+++ b/tests/general/bug-188.out
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<result>
+  <elem other="GOOD" attr="GOOD"/>
+</result>
diff --git a/tests/general/bug-188.xsl b/tests/general/bug-188.xsl
new file mode 100644
index 0000000..da4e34b
--- /dev/null
+++ b/tests/general/bug-188.xsl
@@ -0,0 +1,20 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+  <xsl:import href="bug-188-imp.xsl"/>
+  <xsl:output indent="yes"/>
+
+  <xsl:template match="/">
+    <result>
+      <xsl:element name="elem" use-attribute-sets="set"/>
+    </result>
+  </xsl:template>
+
+  <xsl:attribute-set name="set" use-attribute-sets="used">
+    <xsl:attribute name="other">GOOD</xsl:attribute>
+  </xsl:attribute-set>
+
+  <xsl:attribute-set name="used">
+    <xsl:attribute name="attr">GOOD</xsl:attribute>
+  </xsl:attribute-set>
+
+</xsl:stylesheet>
diff --git a/tests/general/bug-189.out b/tests/general/bug-189.out
new file mode 100644
index 0000000..96bcf2f
--- /dev/null
+++ b/tests/general/bug-189.out
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<result>
+  <elem att1="1" commonatt="2" att2="2"/>
+  <elem att3a="2" att3b="2"/>
+</result>
diff --git a/tests/general/bug-189.xsl b/tests/general/bug-189.xsl
new file mode 100644
index 0000000..515f7f5
--- /dev/null
+++ b/tests/general/bug-189.xsl
@@ -0,0 +1,25 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:output indent="yes"/>
+  <xsl:template match="/">
+    <result>
+      <elem xsl:use-attribute-sets="att1 att2"/>
+      <elem xsl:use-attribute-sets="att3"/>
+    </result>
+  </xsl:template>
+  <xsl:attribute-set name="att1">
+    <xsl:attribute name="att1">1</xsl:attribute>
+    <xsl:attribute name="commonatt">1</xsl:attribute>
+  </xsl:attribute-set>
+  <xsl:attribute-set name="att2">
+    <xsl:attribute name="att2">2</xsl:attribute>
+    <xsl:attribute name="commonatt">2</xsl:attribute>
+  </xsl:attribute-set>
+  <xsl:attribute-set name="att3">
+    <xsl:attribute name="att3a">1</xsl:attribute>
+    <xsl:attribute name="att3a">2</xsl:attribute>
+    <xsl:attribute name="att3b">1</xsl:attribute>
+  </xsl:attribute-set>
+  <xsl:attribute-set name="att3">
+    <xsl:attribute name="att3b">2</xsl:attribute>
+  </xsl:attribute-set>
+</xsl:stylesheet>
diff --git a/tests/general/bug-190-imp.out b/tests/general/bug-190-imp.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/general/bug-190-imp.xsl b/tests/general/bug-190-imp.xsl
new file mode 100644
index 0000000..4936911
--- /dev/null
+++ b/tests/general/bug-190-imp.xsl
@@ -0,0 +1,10 @@
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+  xmlns:ns2="urn:foo">
+
+  <xsl:attribute-set name="ns2:set">
+    <xsl:attribute name="attr">value</xsl:attribute>
+  </xsl:attribute-set>
+
+</xsl:stylesheet>
diff --git a/tests/general/bug-190.out b/tests/general/bug-190.out
new file mode 100644
index 0000000..5dd8f02
--- /dev/null
+++ b/tests/general/bug-190.out
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<result>
+  <elem attr="value"/>
+</result>
diff --git a/tests/general/bug-190.xsl b/tests/general/bug-190.xsl
new file mode 100644
index 0000000..fbaf97e
--- /dev/null
+++ b/tests/general/bug-190.xsl
@@ -0,0 +1,16 @@
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+  xmlns:ns1="urn:foo"
+  exclude-result-prefixes="ns1">
+
+  <xsl:import href="bug-190-imp.xsl"/>
+  <xsl:output indent="yes"/>
+
+  <xsl:template match="/">
+    <result>
+      <elem xsl:use-attribute-sets="ns1:set"/>
+    </result>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/general/bug-191-imp.out b/tests/general/bug-191-imp.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/general/bug-191-imp.xsl b/tests/general/bug-191-imp.xsl
new file mode 100644
index 0000000..782c887
--- /dev/null
+++ b/tests/general/bug-191-imp.xsl
@@ -0,0 +1,8 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:attribute-set name="att2" use-attribute-sets="att3">
+    <xsl:attribute name="att2">2</xsl:attribute>
+  </xsl:attribute-set>
+  <xsl:attribute-set name="att3" use-attribute-sets="att1">
+    <xsl:attribute name="att3">3</xsl:attribute>
+  </xsl:attribute-set>
+</xsl:stylesheet>
diff --git a/tests/general/bug-191.err b/tests/general/bug-191.err
new file mode 100644
index 0000000..10ba2f9
--- /dev/null
+++ b/tests/general/bug-191.err
@@ -0,0 +1,2 @@
+compilation error
+xsl:attribute-set : use-attribute-sets recursion detected on att1
diff --git a/tests/general/bug-191.out b/tests/general/bug-191.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/general/bug-191.xsl b/tests/general/bug-191.xsl
new file mode 100644
index 0000000..548daaa
--- /dev/null
+++ b/tests/general/bug-191.xsl
@@ -0,0 +1,9 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
+  <xsl:import href="bug-191-imp.xsl"/>
+  <xsl:template match="/">
+    <b xsl:use-attribute-sets="att1"/>
+  </xsl:template>
+  <xsl:attribute-set name="att1" use-attribute-sets="att2">
+    <xsl:attribute name="att1">1</xsl:attribute>
+  </xsl:attribute-set>
+</xsl:stylesheet>


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