[xspec] r240 committed - Added @assert and @context attributes. Adapted paths to the new dir s...

0 views
Skip to first unread message

xs...@googlecode.com

unread,
Dec 5, 2011, 1:50:42 PM12/5/11
to xspe...@googlegroups.com
Revision: 240
Author: fgeo...@gmail.com
Date: Mon Dec 5 10:42:06 2011
Log: Added @assert and @context attributes. Adapted paths to the new
dir structure.
http://code.google.com/p/xspec/source/detail?r=240

Modified:
/trunk/test/generate-tests-utils.xspec
/trunk/test/generate-xspec-tests.xspec
/trunk/test/unit-expect-xsl.xspec
/trunk/test/xspec-focus-1.xspec
/trunk/test/xspec-focus-2.xspec
/trunk/test/xspec-function.xspec
/trunk/test/xspec-import.xspec
/trunk/test/xspec-imported.xspec
/trunk/test/xspec-pending.xspec
/trunk/test/xspec-variable.xspec

=======================================
--- /trunk/test/generate-tests-utils.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/generate-tests-utils.xspec Mon Dec 5 10:42:06 2011
@@ -14,8 +14,8 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:test="http://www.jenitennison.com/xslt/unit-test"
query="http://www.jenitennison.com/xslt/unit-test"
- query-at="../generate-query-utils.xql"
- stylesheet="../generate-tests-utils.xsl">
+ query-at="../src/compiler/generate-query-utils.xql"
+ stylesheet="../src/compiler/generate-tests-utils.xsl">

<!--
Test the source files generate-tests-utils.xsl and
generate-query-utils.xql.
@@ -32,6 +32,7 @@
<t:param select="1, 2"/>
</t:call>
<t:expect label="the result" test="$x:result eq true()"/>
+ <t:expect label="the result" assert="$x:result eq true()"/>
</t:scenario>

<t:scenario label="Non-Identical Sequences">
@@ -40,6 +41,7 @@
<t:param select="1, 3"/>
</t:call>
<t:expect label="the result" test="$x:result eq false()"/>
+ <t:expect label="the result" assert="$x:result eq false()"/>
</t:scenario>

<t:scenario label="Sequences with Same Items in Different Orders">
@@ -48,6 +50,7 @@
<t:param select="2, 1"/>
</t:call>
<t:expect label="the result" test="$x:result eq false()"/>
+ <t:expect label="the result" assert="$x:result eq false()"/>
</t:scenario>

<t:scenario label="Empty Sequences">
@@ -56,6 +59,7 @@
<t:param select="()"/>
</t:call>
<t:expect label="the result" test="$x:result eq true()"/>
+ <t:expect label="the result" assert="$x:result eq true()"/>
</t:scenario>

<t:scenario label="One empty sequence">
@@ -64,6 +68,7 @@
<t:param select="1"/>
</t:call>
<t:expect label="the result" test="$x:result eq false()"/>
+ <t:expect label="the result" assert="$x:result eq false()"/>
</t:scenario>

<t:scenario label="A text node and several text nodes">
@@ -76,6 +81,7 @@
<t:param select="$elems/text()"/>
</t:call>
<t:expect label="the result" test="$x:result eq true()"/>
+ <t:expect label="the result" assert="$x:result eq true()"/>
</t:scenario>

</t:scenario>
=======================================
--- /trunk/test/generate-xspec-tests.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/generate-xspec-tests.xspec Mon Dec 5 10:42:06 2011
@@ -11,7 +11,7 @@
<t:description xmlns:t="http://www.jenitennison.com/xslt/xspec"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- stylesheet="../generate-xspec-tests.xsl">
+ stylesheet="../src/compiler/generate-xspec-tests.xsl">

<!--
Test the source file generate-xspec-tests.xsl.
@@ -27,6 +27,7 @@
</t:variable>
<t:apply select="$ctxt"/>
<t:expect label="the result" test="$t:result instance of
document-node()"/>
+ <t:expect label="the result" assert="$t:result instance of
document-node()"/>
</t:scenario-->

<t:scenario label="FIRST TEST.......">
@@ -42,6 +43,16 @@
<t:expect label="the label message" test="$t:result/xsl:message
eq 'my label'"/>
<t:expect label="the scenario"
test="exists($t:result/t:scenario)"/>
<t:expect label="the scenario label"
test="$t:result/t:scenario/t:label eq 'my label'"/>
+ <!-- TODO: Use @assert instead of @test... -->
+ <t:expect label="is a template" assert="$t:result instance of
element(xsl:template)"/>
+ <!-- test also it is a QName in the namespace x:* -->
+ <t:expect label="the name" assert="exists($t:result/@name)"/>
+ <t:expect label="the name is a QName" assert="
+ namespace-uri-from-QName(resolve-QName($t:result/@name,
$t:result))
+ eq 'http://www.jenitennison.com/xslt/xspec'"/>
+ <t:expect label="the label message" assert="$t:result/xsl:message
eq 'my label'"/>
+ <t:expect label="the scenario"
assert="exists($t:result/t:scenario)"/>
+ <t:expect label="the scenario label"
assert="$t:result/t:scenario/t:label eq 'my label'"/>
</t:scenario>

</t:scenario>
=======================================
--- /trunk/test/unit-expect-xsl.xspec Mon Sep 12 04:00:01 2011
+++ /trunk/test/unit-expect-xsl.xspec Mon Dec 5 10:42:06 2011
@@ -34,6 +34,12 @@
test="$t:result/xsl:variable[@name
eq 'impl:test-result']/*/xsl:otherwise/*">
<xsl:sequence select="false()" version="..."/>
</t:expect>
+ <t:expect label="is a template"
+ assert="$t:result instance of element(xsl:template)"/>
+ <t:expect label="@test must be transformed to @select"
+ context="$t:result/xsl:variable[@name
eq 'impl:test-result']/*/xsl:otherwise/*">
+ <xsl:sequence select="false()" version="..."/>
+ </t:expect>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-focus-1.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-focus-1.xspec Mon Dec 5 10:42:06 2011
@@ -27,6 +27,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending must fail">
@@ -34,6 +35,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
+ <t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

<!--
@@ -44,6 +46,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="focus must fail" focus="focus">
@@ -51,6 +54,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
+ <t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-focus-2.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-focus-2.xspec Mon Dec 5 10:42:06 2011
@@ -31,6 +31,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending call (element) + focus" focus="focus">
@@ -38,6 +39,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

</t:pending>
@@ -50,6 +52,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="call + focus" focus="focus">
@@ -57,6 +60,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<!--
@@ -68,6 +72,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<!-- does not make sense, really, but to see how the implem reacts -->
@@ -78,6 +83,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-function.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-function.xspec Mon Dec 5 10:42:06 2011
@@ -22,6 +22,8 @@
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the type" test="$x:result instance of
xs:integer"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
+ <t:expect label="the type" assert="$x:result instance of
xs:integer"/>
</t:scenario>

<t:scenario label="must fail">
@@ -29,6 +31,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="wrong result" test="$x:result eq 42"/>
+ <t:expect label="wrong result" assert="$x:result eq 42"/>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-import.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-import.xspec Mon Dec 5 10:42:06 2011
@@ -25,6 +25,8 @@
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
<t:expect label="the type" test="$x:result instance of
xs:integer"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
+ <t:expect label="the type" assert="$x:result instance of
xs:integer"/>
</t:scenario>

<t:scenario label="must fail">
@@ -32,6 +34,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
+ <t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-imported.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-imported.xspec Mon Dec 5 10:42:06 2011
@@ -21,6 +21,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="must fail">
@@ -28,6 +29,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="wrong result" test="$x:result eq 42"/>
+ <t:expect label="wrong result" assert="$x:result eq 42"/>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-pending.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-pending.xspec Mon Dec 5 10:42:06 2011
@@ -31,6 +31,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending must fail (element)">
@@ -38,6 +39,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of
xs:string"/>
+ <t:expect label="the type" assert="$x:result instance of
xs:string"/>
</t:scenario>

</t:pending>
@@ -50,6 +52,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="must fail">
@@ -57,6 +60,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
+ <t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

<!--
@@ -67,6 +71,7 @@
<t:param select="3"/>
</t:call>
<t:expect label="the result" test="$x:result eq 9"/>
+ <t:expect label="the result" assert="$x:result eq 9"/>
</t:scenario>

<t:scenario label="pending must fail (attribute)" pending="testing
pending attribute">
@@ -74,6 +79,7 @@
<t:param select="2"/>
</t:call>
<t:expect label="the type" test="$x:result instance of xs:string"/>
+ <t:expect label="the type" assert="$x:result instance of xs:string"/>
</t:scenario>

</t:description>
=======================================
--- /trunk/test/xspec-variable.xspec Fri Sep 17 14:50:46 2010
+++ /trunk/test/xspec-variable.xspec Mon Dec 5 10:42:06 2011
@@ -25,6 +25,7 @@
<t:param select="$test-3/@num"/>
</t:call>
<t:expect label="the result" test="$x:result eq
$test-3/xs:integer(@value)"/>
+ <t:expect label="the result" assert="$x:result eq
$test-3/xs:integer(@value)"/>
</t:scenario>

<!--
@@ -40,6 +41,7 @@
</t:call>
<t:variable name="result" select="$test-3/@value"/>
<t:expect label="the result" test="$x:result eq
xs:integer($result)"/>
+ <t:expect label="the result" assert="$x:result eq
xs:integer($result)"/>
</t:scenario>

</t:description>

Reply all
Reply to author
Forward
0 new messages