summaryrefslogtreecommitdiff
path: root/tests/general
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2004-11-22 00:11:24 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2004-11-22 00:11:24 +0000
commit15828d4cde05a61835f0d9306e0d35769489bdc4 (patch)
tree4c48bdf54632a9b128cf67f49c88b15939056c45 /tests/general
parentded18bc6c2c1b9f3b77a2477b204076b24684b55 (diff)
downloadlibxslt-15828d4cde05a61835f0d9306e0d35769489bdc4.tar.gz
libxslt-15828d4cde05a61835f0d9306e0d35769489bdc4.tar.bz2
libxslt-15828d4cde05a61835f0d9306e0d35769489bdc4.zip
small change to previous fix for bug 153137, fixes bug 158840. added test
* libxslt/pattern.c: small change to previous fix for bug 153137, fixes bug 158840. * tests/general/bug-157.*, tests/general/Makefile.am, tests/docs/bug-157.*, tests/docs/Makefile.am: added test for this
Diffstat (limited to 'tests/general')
-rw-r--r--tests/general/Makefile.am1
-rw-r--r--tests/general/bug-157.err3
-rw-r--r--tests/general/bug-157.out9
-rw-r--r--tests/general/bug-157.xsl22
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am
index afd03208..98059cad 100644
--- a/tests/general/Makefile.am
+++ b/tests/general/Makefile.am
@@ -165,6 +165,7 @@ EXTRA_DIST = \
bug-155.out bug-155.xsl \
bug-156.err bug-156.out bug-156.xsl \
bug-156.imp1.imp bug-156.imp2.imp \
+ bug-157.err bug-157.out bug-157.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-157.err b/tests/general/bug-157.err
new file mode 100644
index 00000000..c0329a8b
--- /dev/null
+++ b/tests/general/bug-157.err
@@ -0,0 +1,3 @@
+last() was 3
+last() was 3
+last() was 3
diff --git a/tests/general/bug-157.out b/tests/general/bug-157.out
new file mode 100644
index 00000000..a5db75ff
--- /dev/null
+++ b/tests/general/bug-157.out
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+
+ 3 me
+
+ 3 you
+
+ 3 others
+
diff --git a/tests/general/bug-157.xsl b/tests/general/bug-157.xsl
new file mode 100644
index 00000000..349fc8e2
--- /dev/null
+++ b/tests/general/bug-157.xsl
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="/"><xsl:apply-templates select="*" /></xsl:template>
+<xsl:template match="foo/bar[last()=4]">
+ 4 <xsl:value-of select="." />
+</xsl:template>
+<xsl:template match="foo/bar[last()=3]">
+ <xsl:message>last() was 3</xsl:message>
+ 3 <xsl:value-of select="." />
+</xsl:template>
+<xsl:template match="foo/bar[last()=2]">
+ 2 <xsl:value-of select="." />
+</xsl:template>
+<xsl:template match="foo/bar[last()=1]">
+ 1 <xsl:value-of select="." />
+</xsl:template>
+
+<xsl:template match="foo/bar" priority="-100">
+ <xsl:message>last() was <xsl:value-of select="last()"/></xsl:message>
+</xsl:template>
+</xsl:stylesheet>