summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-04-15 12:02:03 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-04-15 12:02:03 +0000
commit42681a3efe05f484882e834c55df1f38419f6827 (patch)
tree9848caf7ecddc9e5dfd86df74596932df1206248 /tests
parent4ec7719012d97c1364b9c46dd9e15599384983ea (diff)
downloadlibxslt-42681a3efe05f484882e834c55df1f38419f6827.tar.gz
libxslt-42681a3efe05f484882e834c55df1f38419f6827.tar.bz2
libxslt-42681a3efe05f484882e834c55df1f38419f6827.zip
fixed bug #78735 added the tests in a separate directory Daniel
* libxslt/keys.c: fixed bug #78735 * configure.in tests/Makefile.am tests/keys/*: added the tests in a separate directory Daniel
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/keys/Makefile.am22
-rw-r--r--tests/keys/dates.xml7
-rw-r--r--tests/keys/month.out7
-rw-r--r--tests/keys/month.xml9
-rw-r--r--tests/keys/month.xsl19
6 files changed, 65 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3690bdc5..a1589203 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS=docs REC1 REC2 REC general namespaces numbers documents \
+SUBDIRS=docs REC1 REC2 REC general namespaces keys numbers documents \
extensions reports xmlspec multiple XSLTMark docbook exslt
all:
diff --git a/tests/keys/Makefile.am b/tests/keys/Makefile.am
new file mode 100644
index 00000000..f47115a5
--- /dev/null
+++ b/tests/keys/Makefile.am
@@ -0,0 +1,22 @@
+## Process this file with automake to produce Makefile.in
+
+$(top_builddir)/xsltproc/xsltproc:
+ @(cd ../../xsltproc ; $(MAKE) xsltproc)
+
+EXTRA_DIST = dates.xml month.xml month.xsl month.out
+
+all:
+
+valgrind:
+ @echo '## Running the regression tests under Valgrind'
+ $(MAKE) CHECKER='valgrind -q' tests
+
+test tests: $(top_builddir)/xsltproc/xsltproc
+ @(echo > .memdump)
+ @($(CHECKER) $(top_builddir)/xsltproc/xsltproc $(srcdir)/month.xsl $(srcdir)/dates.xml > month.res ; \
+ if [ -r $(srcdir)/month.out ] ; \
+ then diff $(srcdir)/month.out month.res ; \
+ else mv month.res $(srcdir)/month.out ; fi ; \
+ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\
+ rm -f month.res)
+
diff --git a/tests/keys/dates.xml b/tests/keys/dates.xml
new file mode 100644
index 00000000..cef3228d
--- /dev/null
+++ b/tests/keys/dates.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<dates>
+ <month>12</month>
+ <month>Dec</month>
+ <month>December</month>
+ <month>dismember</month>
+</dates>
diff --git a/tests/keys/month.out b/tests/keys/month.out
new file mode 100644
index 00000000..180559d6
--- /dev/null
+++ b/tests/keys/month.out
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<dates>
+ <month>December</month>
+ <month>December</month>
+ <month>December</month>
+ <month></month>
+</dates>
diff --git a/tests/keys/month.xml b/tests/keys/month.xml
new file mode 100644
index 00000000..445ba698
--- /dev/null
+++ b/tests/keys/month.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<list>
+ <month>
+ <alias>December</alias>
+ <alias>12</alias>
+ <alias>Dec</alias>
+ <alias>DEC</alias>
+ </month>
+</list>
diff --git a/tests/keys/month.xsl b/tests/keys/month.xsl
new file mode 100644
index 00000000..336c0364
--- /dev/null
+++ b/tests/keys/month.xsl
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output indent="no" version="1.0" encoding="iso-8859-1"/>
+ <xsl:key name="monthlist" match="/list/month" use="./alias"/>
+ <xsl:template match="month">
+ <month>
+ <xsl:variable name="value" select="."/>
+ <xsl:for-each select="document('month.xml')">
+ <xsl:value-of select="key('monthlist', $value)/alias[1]"/>
+ </xsl:for-each>
+ </month>
+ </xsl:template>
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>