Skip to content
Permalink
Browse files

Adding tests accept-901 - accept-915 for scenarios involving variants…

… of (improperly) accepting abstract components. Tests errors XTDE3052, XTSE3080, XTDE0040, XTSE0020
  • Loading branch information...
abelbraaksma
abelbraaksma committed Feb 25, 2019
1 parent a1f9aa5 commit 577745788a5483c06a959a639122e3949535e90a
@@ -28,3 +28,4 @@ tests/misc/regex-classes/_regex-classes-test-set.xslt
tests/fn/json-to-xml/_json-to-xml-test-set.xslt
tests/fn/xml-to-json/_xml-to-json-test-set.xslt
tests/type/type/report-overview.html
tests/decl/accumulator/_accumulator-test-set.xslt
@@ -519,5 +519,187 @@
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-901">
<description>Error, simple test, accept xsl:initial-template, specifically hidden abstract component (function) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-901.xsl" role="principal"/>
<package file="accept-901-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-902">
<description>Error, simple test, accept xsl:initial-template, implicitly hidden abstract component (function) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-902.xsl" role="principal"/>
<package file="accept-901-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-903">
<description>Error, simple test, accept xsl:initial-template, accidentally hidden abstract component (function) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-903.xsl" role="principal"/>
<package file="accept-901-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-904">
<description>Error, simple test non-executable package, wildcard accepted abstract component (function) is NOK, raises statically XTSE3080</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-904.xsl" role="principal"/>
<package file="accept-901-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0"/>
</test>
<result>
<error code="XTSE3080"/>
</result>
</test-case>

<test-case name="accept-905">
<description>Error, simple test, accept xsl:initial-template, specifically hidden abstract component (template) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-905.xsl" role="principal"/>
<package file="accept-905-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-906">
<description>Error, simple test, accept xsl:initial-template, implicitly hidden abstract component (template) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-906.xsl" role="principal"/>
<package file="accept-905-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-907">
<description>Error, simple test, accept xsl:initial-template, accidentally hidden abstract component (template) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-907.xsl" role="principal"/>
<package file="accept-905-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-908">
<description>Error, simple test non-executable package, wildcard accepted abstract component (template) is NOK, raises statically XTSE3080</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-908.xsl" role="principal"/>
<package file="accept-905-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0"/>
</test>
<result>
<error code="XTSE3080"/>
</result>
</test-case>

<test-case name="accept-909">
<description>Error, simple test, accept xsl:initial-template, specifically hidden abstract component (template) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-909.xsl" role="principal"/>
<package file="accept-909-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-909" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-910">
<description>Error, simple test, accept xsl:initial-template, implicitly hidden abstract component (template) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-910.xsl" role="principal"/>
<package file="accept-909-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-909" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-911">
<description>Error, simple test, accept xsl:initial-template, accidentally hidden abstract component (template) is OK, but raises XTDE3052</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-911.xsl" role="principal"/>
<package file="accept-909-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-909" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE3052"/>
</result>
</test-case>

<test-case name="accept-912">
<description>Error, simple test non-executable package, wildcard accepted abstract component (template) is NOK, raises statically XTSE3080</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-912.xsl" role="principal"/>
<package file="accept-909-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-909" package-version="1.0.0"/>
</test>
<result>
<error code="XTSE3080"/>
</result>
</test-case>

<test-case name="accept-913">
<description>Error, simple test template xsl:initial-template must be public, raises XTDE0040 (not XTDE3052)</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-913.xsl" role="principal"/>
<package file="accept-913-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-913" package-version="1.0.0"/>
</test>
<result>
<error code="XTDE0040"/>
</result>
</test-case>

<test-case name="accept-914">
<description>Error, simple test non-executable package with xsl:initial-template, raises XTSE3080 (not XTDE0040)</description>
<created by="Abel Braaksma" on="2019-02-18"/>
<test>
<package file="accept-914.xsl" role="principal"/>
<package file="accept-914-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-914" package-version="1.0.0"/>
</test>
<result>
<error code="XTSE3080"/>
</result>
</test-case>

<test-case name="accept-915">
<description>Error, cannot use special token #unnamed to refer to the always private-to-a-package unnamed mode (like expose-015)</description>
<created by="Abel Braaksma" on="2019-02-02"/>
<test>
<package file="accept-915.xsl" role="principal"/>
<package file="accept-915-package.xsl" role="secondary" uri="http://www.w3.org/xslt30tests/package-915" package-version="1.0.0"/>
</test>
<result>
<error code="XTSE0020"/>
</result>
</test-case>



</test-set>
@@ -0,0 +1,19 @@
<xsl:package
name="http://www.w3.org/xslt30tests/package-901"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:f="urn:functions">

<!-- tests error XTDE3052 to be raised on abstract function -->

<xsl:function name="f:abstract" visibility="abstract" as="xs:ID">
<xsl:param name="one" as="xs:string" />
</xsl:function>

<xsl:template name="xsl:initial-template" visibility="public">
<not-ok><xsl:value-of select="f:abstract('test')" /></not-ok>
</xsl:template>

</xsl:package>
@@ -0,0 +1,15 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-901"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTDE3052 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- if a wildcard matches, and the visibility combination is allowed, it applies to the matching component -->
<xsl:accept names="*" visibility="hidden" component="*" />
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,14 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-902"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTDE3052 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- visibility abstract becomes hidden if not explicitly accepted -->
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,14 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-903"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTDE3052 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0">
<!-- if a wildcard has an invalid combination (abstract -> public) it is treated as a non-match, and abstract gets default: hidden -->
<xsl:accept names="*" visibility="public" component="*" />
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,15 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-904"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTSE3080 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-901" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- valid wildcard combination for abstract function -->
<xsl:accept names="*" visibility="abstract" component="*" />
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,19 @@
<xsl:package
name="http://www.w3.org/xslt30tests/package-905"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:t="urn:templates">

<!-- tests error XTDE3052 to be raised on abstract template -->

<xsl:template name="t:abstract" visibility="abstract" as="xs:ID">
<xsl:param name="one" as="xs:string" />
</xsl:template>

<xsl:template name="xsl:initial-template" visibility="public">
<not-ok><xsl:call-template name="t:abstract" /></not-ok>
</xsl:template>

</xsl:package>
@@ -0,0 +1,15 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-905"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTDE3052 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- if a wildcard matches, and the visibility combination is allowed, it applies to the matching component -->
<xsl:accept names="*" visibility="hidden" component="*" />
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,14 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-906"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTDE3052 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- visibility abstract becomes hidden if not explicitly accepted -->
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,15 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-907"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTDE3052 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- if a wildcard has an invalid combination (abstract -> public) it is treated as a non-match, and abstract gets default: hidden -->
<xsl:accept names="*" visibility="public" component="*" />
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,15 @@
<xsl:package
name="http://www.w3.org/xslt30tests/accept-908"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- tests error XTSE3080 to be raised on abstract component -->

<xsl:use-package name="http://www.w3.org/xslt30tests/package-905" package-version="1.0.0">
<xsl:accept names="xsl:initial-template" visibility="public" component="template" />
<!-- valid wildcard combination for abstract template -->
<xsl:accept names="*" visibility="abstract" component="*" />
</xsl:use-package>

</xsl:package>
@@ -0,0 +1,18 @@
<xsl:package
name="http://www.w3.org/xslt30tests/package-909"
package-version="1.0.0"
version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:a="urn:attribute-set">

<!-- tests error XTDE3052 to be raised on abstract attribute-set -->

<xsl:attribute-set name="a:abstract" visibility="abstract">
</xsl:attribute-set>

<xsl:template name="xsl:initial-template" visibility="public">
<not-ok xsl:use-attribute-sets="a:abstract"/>
</xsl:template>

</xsl:package>
Oops, something went wrong.

0 comments on commit 5777457

Please sign in to comment.
You can’t perform that action at this time.