diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2005-07-10 14:20:06 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2005-07-10 14:20:06 +0000 |
commit | 8cd3ee959b3c4d7d95ad6033dcb6e8d59b320822 (patch) | |
tree | abe48eed802250c75d223d27486a41c505f454cd /tests | |
parent | f39f519162c185a0ecba9476d1bbea1db1b8ef93 (diff) | |
download | libxslt-8cd3ee959b3c4d7d95ad6033dcb6e8d59b320822.tar.gz libxslt-8cd3ee959b3c4d7d95ad6033dcb6e8d59b320822.tar.bz2 libxslt-8cd3ee959b3c4d7d95ad6033dcb6e8d59b320822.zip |
try to avoid generating conflicts applied patch from Mark Vakoc to
* libxslt/xsltwin32config.h*: try to avoid generating conflicts
* libexslt/dynamic.c: applied patch from Mark Vakoc to implement
dyn:map
* configure.in tests/exslt/Makefile.am tests/exslt/dynamic/*:
added test for dyn:map to the regression suite
Daniel
Diffstat (limited to 'tests')
-rw-r--r-- | tests/exslt/Makefile.am | 2 | ||||
-rw-r--r-- | tests/exslt/dynamic/Makefile.am | 46 | ||||
-rw-r--r-- | tests/exslt/dynamic/dynmap.out | 41 | ||||
-rw-r--r-- | tests/exslt/dynamic/dynmap.xml | 29 | ||||
-rw-r--r-- | tests/exslt/dynamic/dynmap.xsl | 24 |
5 files changed, 141 insertions, 1 deletions
diff --git a/tests/exslt/Makefile.am b/tests/exslt/Makefile.am index cc2fcb86..bbfc7e3e 100644 --- a/tests/exslt/Makefile.am +++ b/tests/exslt/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS=common functions math sets strings date +SUBDIRS=common functions math sets strings dynamic date all: diff --git a/tests/exslt/dynamic/Makefile.am b/tests/exslt/dynamic/Makefile.am new file mode 100644 index 00000000..3cf82638 --- /dev/null +++ b/tests/exslt/dynamic/Makefile.am @@ -0,0 +1,46 @@ +## Process this file with automake to produce Makefile.in + +$(top_builddir)/xsltproc/xsltproc: + @(cd ../../../xsltproc ; $(MAKE) xsltproc) + +EXTRA_DIST = \ + dynmap.out dynmap.xml dynmap.xsl + +all: + +valgrind: + @echo '## Running the regression tests under Valgrind' + $(MAKE) CHECKER='valgrind -q' tests + +test tests: $(top_builddir)/xsltproc/xsltproc + @echo '## Running exslt sets tests' + @(echo > .memdump) + @(for i in $(srcdir)/*.xsl ; do \ + name=`basename $$i .xsl` ; \ + if [ ! -f $(srcdir)/$$name.xml ] ; then continue ; fi ; \ + log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \ + $(srcdir)/$$name.xsl $(srcdir)/$$name.xml > $$name.res 2>$$name.bad;\ + if [ ! -f $(srcdir)/$$name.out ] ; then \ + cp $$name.res $(srcdir)/$$name.out ; \ + if [ -s $$name.bad ] ; then \ + mv $$name.bad $(srcdir)/$$name.err ; \ + fi ; \ + else \ + if [ ! -s $$name.res ] ; then \ + echo "Fatal error, no $$name.res\n" ; \ + else \ + diff $(srcdir)/$$name.out $$name.res ; \ + if [ -s $(srcdir)/$$name.err ] ; then \ + diff $(srcdir)/$$name.err $$name.bad; \ + else \ + diff /dev/null $$name.bad; \ + fi ; \ + fi ; \ + fi; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true`;\ + if [ -n "$$log" ] ; then \ + echo $$name result ; \ + echo $$log ; \ + fi ; \ + rm -f $$name.res $$name.bad ; \ + done) diff --git a/tests/exslt/dynamic/dynmap.out b/tests/exslt/dynamic/dynmap.out new file mode 100644 index 00000000..b75b87cf --- /dev/null +++ b/tests/exslt/dynamic/dynmap.out @@ -0,0 +1,41 @@ +<?xml version="1.0"?> +<result> + <node-set> + <childNode2>bbbb</childNode2> + <childNode4>dddd</childNode4> + <childNode6>ffff</childNode6> + <childNode8>hhhh</childNode8> + <childNode1>jjjj</childNode1> + <childNode3>llll</childNode3> + <childNode5>nnnn</childNode5> + <childNode7>pppp</childNode7> + <childNode9>rrrr</childNode9> + </node-set> + <boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + <exsl:boolean xmlns:exsl="http://exslt.org/common">true</exsl:boolean> + </boolean> + <number> + <exsl:number xmlns:exsl="http://exslt.org/common">9</exsl:number> + <exsl:number xmlns:exsl="http://exslt.org/common">0</exsl:number> + <exsl:number xmlns:exsl="http://exslt.org/common">0</exsl:number> + <exsl:number xmlns:exsl="http://exslt.org/common">0</exsl:number> + <exsl:number xmlns:exsl="http://exslt.org/common">0</exsl:number> + <exsl:number xmlns:exsl="http://exslt.org/common">0</exsl:number> + <exsl:number xmlns:exsl="http://exslt.org/common">9</exsl:number> + </number> + <string> + <exsl:string xmlns:exsl="http://exslt.org/common">with-child</exsl:string> + <exsl:string xmlns:exsl="http://exslt.org/common">without-child</exsl:string> + <exsl:string xmlns:exsl="http://exslt.org/common">without-child</exsl:string> + <exsl:string xmlns:exsl="http://exslt.org/common">without-child</exsl:string> + <exsl:string xmlns:exsl="http://exslt.org/common">without-child</exsl:string> + <exsl:string xmlns:exsl="http://exslt.org/common">without-child</exsl:string> + <exsl:string xmlns:exsl="http://exslt.org/common">with-child</exsl:string> + </string> +</result> diff --git a/tests/exslt/dynamic/dynmap.xml b/tests/exslt/dynamic/dynmap.xml new file mode 100644 index 00000000..8f069a86 --- /dev/null +++ b/tests/exslt/dynamic/dynmap.xml @@ -0,0 +1,29 @@ +<dynmap> + <with-child> + <childNode1>aaa</childNode1> + <childNode2>bbbb</childNode2> + <childNode3>ccc</childNode3> + <childNode4>dddd</childNode4> + <childNode5>eee</childNode5> + <childNode6>ffff</childNode6> + <childNode7>ggg</childNode7> + <childNode8>hhhh</childNode8> + <childNode9>iii</childNode9> + </with-child> + <without-child>some text</without-child> + <without-child>some text</without-child> + <without-child>some text</without-child> + <without-child>some text</without-child> + <without-child>some text</without-child> + <with-child> + <childNode1>jjjj</childNode1> + <childNode2>kkk</childNode2> + <childNode3>llll</childNode3> + <childNode4>mmm</childNode4> + <childNode5>nnnn</childNode5> + <childNode6>ooo</childNode6> + <childNode7>pppp</childNode7> + <childNode8>qqq</childNode8> + <childNode9>rrrr</childNode9> + </with-child> +</dynmap> diff --git a/tests/exslt/dynamic/dynmap.xsl b/tests/exslt/dynamic/dynmap.xsl new file mode 100644 index 00000000..bfcef581 --- /dev/null +++ b/tests/exslt/dynamic/dynmap.xsl @@ -0,0 +1,24 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:dyn="http://exslt.org/dynamic" + exclude-result-prefixes="dyn" +> +<xsl:output indent="yes"/> + +<xsl:template match="/dynmap"> +<result> + <node-set> + <xsl:copy-of select="dyn:map(*, 'child::*[string-length(.) > 3]')"/> + </node-set> + <boolean> + <xsl:copy-of select="dyn:map(*, 'string-length(name()) > 3')"/> + </boolean> + <number> + <xsl:copy-of select="dyn:map(*, 'count(*)')"/> + </number> + <string> + <xsl:copy-of select="dyn:map(*, 'name()')"/> + </string> +</result> +</xsl:template> +</xsl:stylesheet> + |