diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-09-17 12:52:18 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-09-17 12:52:18 +0000 |
commit | 2db3204c7d21e52f64801dfbd28449c843893cb0 (patch) | |
tree | a839b7c542d00b0e73eb609de0b08b7605294dd8 /tests | |
parent | ecf1181ac1fe6468b7d61f4637ec1b0f765ee641 (diff) | |
download | libxslt-2db3204c7d21e52f64801dfbd28449c843893cb0.tar.gz libxslt-2db3204c7d21e52f64801dfbd28449c843893cb0.tar.bz2 libxslt-2db3204c7d21e52f64801dfbd28449c843893cb0.zip |
fixed a problem with global var override being reported as an error. added
* libxslt/variables.c: fixed a problem with global var override
being reported as an error.
* tests/docs/Makefile.am tests/docs/bug-61.xml
tests/general/Makefile.am tests/general/bug-61.*: added a
specific example in the regression tests
* configure.in tests/Makefile.am tests/reports/*: adding a test
to make sure redefinition of global variables in the same stylesheet
are still reported
Daniel
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/docs/Makefile.am | 1 | ||||
-rw-r--r-- | tests/docs/bug-62.xml | 1 | ||||
-rw-r--r-- | tests/general/Makefile.am | 2 | ||||
-rw-r--r-- | tests/general/bug-62-inc.out | 0 | ||||
-rw-r--r-- | tests/general/bug-62-inc.xsl | 4 | ||||
-rw-r--r-- | tests/general/bug-62.out | 2 | ||||
-rw-r--r-- | tests/general/bug-62.xsl | 8 | ||||
-rw-r--r-- | tests/reports/Makefile.am | 32 | ||||
-rw-r--r-- | tests/reports/tst-1.err | 2 | ||||
-rw-r--r-- | tests/reports/tst-1.out | 2 | ||||
-rw-r--r-- | tests/reports/tst-1.xml | 1 | ||||
-rw-r--r-- | tests/reports/tst-1.xsl | 8 |
13 files changed, 64 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index f31e08ca..9c102d99 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in SUBDIRS=docs REC1 REC2 REC general namespaces numbers documents \ - extensions xmlspec multiple XSLTMark docbook exslt + extensions reports xmlspec multiple XSLTMark docbook exslt all: diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am index 045170ec..c8afbf75 100644 --- a/tests/docs/Makefile.am +++ b/tests/docs/Makefile.am @@ -63,6 +63,7 @@ EXTRA_DIST = \ bug-59.xml \ bug-60.xml \ bug-61.xml \ + bug-62.xml \ character.xml \ array.xml \ items.xml diff --git a/tests/docs/bug-62.xml b/tests/docs/bug-62.xml new file mode 100644 index 00000000..69d62f2c --- /dev/null +++ b/tests/docs/bug-62.xml @@ -0,0 +1 @@ +<doc/> diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 58902be0..a971f446 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -65,6 +65,8 @@ EXTRA_DIST = \ bug-59.out bug-59.xsl \ bug-60.out bug-60.xsl \ bug-61.out bug-61.xsl \ + bug-62-inc.out bug-62-inc.xsl \ + bug-62.out bug-62.xsl \ character.out character.xsl \ character2.out character2.xsl \ itemschoose.out itemschoose.xsl \ diff --git a/tests/general/bug-62-inc.out b/tests/general/bug-62-inc.out new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/general/bug-62-inc.out diff --git a/tests/general/bug-62-inc.xsl b/tests/general/bug-62-inc.xsl new file mode 100644 index 00000000..c36ff6e3 --- /dev/null +++ b/tests/general/bug-62-inc.xsl @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:variable name="my.var">old-value</xsl:variable> +</xsl:stylesheet> diff --git a/tests/general/bug-62.out b/tests/general/bug-62.out new file mode 100644 index 00000000..c2f781e3 --- /dev/null +++ b/tests/general/bug-62.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +the-value diff --git a/tests/general/bug-62.xsl b/tests/general/bug-62.xsl new file mode 100644 index 00000000..ccfca35d --- /dev/null +++ b/tests/general/bug-62.xsl @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:import href="bug-62-inc.xsl"/> + <xsl:variable name="my.var">the-value</xsl:variable> + <xsl:template match="/"> + <xsl:value-of select="$my.var"/> + </xsl:template> +</xsl:stylesheet> diff --git a/tests/reports/Makefile.am b/tests/reports/Makefile.am new file mode 100644 index 00000000..75a4f29b --- /dev/null +++ b/tests/reports/Makefile.am @@ -0,0 +1,32 @@ +## Process this file with automake to produce Makefile.in + +$(top_builddir)/xsltproc/xsltproc: + @(cd ../../xsltproc ; $(MAKE) xsltproc) + +EXTRA_DIST = \ + tst-1.xml tst-1.xsl tst-1.out tst-1.err + + +all: test + +test tests: $(top_builddir)/xsltproc/xsltproc + @(echo > .memdump) + @(for i in $(srcdir)/*.xml ; do \ + if [ -d $$i ] ; then continue ; fi ; \ + doc=`basename $$i .xml` ; \ + for j in $(srcdir)/$$doc*.xsl ; do \ + if [ ! -f $$j ] ; then continue ; fi ; \ + if [ -d $$j ] ; then continue ; fi ; \ + name=`basename $$j .xsl`; \ + out=$(srcdir)/"$$name".out; \ + err=$(srcdir)/"$$name".err; \ + echo Running $$j on $$i ; \ + $(top_builddir)/xsltproc/xsltproc $$j $$i > result.$$name \ + 2> err.$$name ; \ + if [ ! -f $$out ] ; \ + then cp result.$$name $$out; cp err.$$name $$err ; \ + else diff $$out result.$$name; diff $$err err.$$name; fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ + rm -f result.$$name err.$$name ; \ + done ; done) + diff --git a/tests/reports/tst-1.err b/tests/reports/tst-1.err new file mode 100644 index 00000000..9815eb17 --- /dev/null +++ b/tests/reports/tst-1.err @@ -0,0 +1,2 @@ +runtime error: file ./tst-1.xsl line 4 element variable +Global variable my.var already defined diff --git a/tests/reports/tst-1.out b/tests/reports/tst-1.out new file mode 100644 index 00000000..7e3e9b40 --- /dev/null +++ b/tests/reports/tst-1.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +old-value diff --git a/tests/reports/tst-1.xml b/tests/reports/tst-1.xml new file mode 100644 index 00000000..69d62f2c --- /dev/null +++ b/tests/reports/tst-1.xml @@ -0,0 +1 @@ +<doc/> diff --git a/tests/reports/tst-1.xsl b/tests/reports/tst-1.xsl new file mode 100644 index 00000000..4af7ca1e --- /dev/null +++ b/tests/reports/tst-1.xsl @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:variable name="my.var">old-value</xsl:variable> + <xsl:variable name="my.var">the-value</xsl:variable> + <xsl:template match="/"> + <xsl:value-of select="$my.var"/> + </xsl:template> +</xsl:stylesheet> |