Skip to content

Commit

Permalink
Missing XQuery dependency declarations added. #82
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGruen committed Mar 21, 2024
1 parent 1e2536f commit c2f1afc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions prod/DynamicFunctionCall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<test-case name="DynamicFunctionCall-004">
<description>Test that arguments are atomized - user-defined function</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := fn($in as xs:boolean) as xs:boolean { $in }
return $f(<a>0</a>)]]></test>
Expand Down Expand Up @@ -197,6 +198,7 @@
<test-case name="DynamicFunctionCall-014" covers-30="inline-function">
<description>Test that the untypedAtomic result of an inline function is cast to the declared type.</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := function($a as xs:integer, $b as xs:integer) as xs:integer {
data(<a>{$a}{$b}</a>)
Expand Down Expand Up @@ -257,6 +259,7 @@
<test-case name="DynamicFunctionCall-023">
<description>Test that a sequence of arguments is atomized</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := string-join(?, '|')
return $f((<a>X</a>, <a>Y</a>, <a>Z</a>))
Expand All @@ -269,6 +272,7 @@
<test-case name="DynamicFunctionCall-024">
<description>Test that a sequence of arguments is atomized</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := fn($s as xs:NCName*) {deep-equal($s, ("X", "Y", "Z"))}
return $f((<a>X</a>, <a>Y</a>, <a>Z</a>))]]></test>
Expand Down Expand Up @@ -643,6 +647,7 @@
<test-case name="DynamicFunctionCall-R-004">
<description>Test that arguments are atomized - user-defined function - record test</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := fn($in as record(x as xs:boolean)) as xs:boolean { $in?x }
return $f(map{'x':<a>0</a>})]]></test>
Expand Down Expand Up @@ -782,6 +787,7 @@
<description>Test that the untypedAtomic result of an inline function is cast
to the declared type. Within record test.</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := function($a as xs:integer, $b as xs:integer) as record(x as xs:integer) {
map{'x':data(<a>{$a}{$b}</a>)}
Expand Down Expand Up @@ -844,6 +850,7 @@
<test-case name="DynamicFunctionCall-R-024">
<description>Test that a sequence of arguments is atomized. Within record test.</description>
<created by="Michael Kay" on="2024-02-09"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
let $f := fn($s as record(x as xs:NCName*)) {deep-equal($s?x, ("X", "Y", "Z"))}
return $f(map{'x':(<a>X</a>, <a>Y</a>, <a>Z</a>)})]]></test>
Expand Down
7 changes: 7 additions & 0 deletions prod/StringTemplate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ bottles`
<test-case name="string-template-910">
<description>Maps can't be atomized</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
declare variable $n external := map{'a':10};
`There were {$n} green bottles`
Expand All @@ -567,6 +568,7 @@ bottles`
<test-case name="string-template-911">
<description>Maps can't be atomized</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
declare variable $n external := map{'a':10};
`There were {map{'a':10}} green bottles`
Expand All @@ -592,6 +594,7 @@ bottles`
<test-case name="string-template-913">
<description>Not allowed as literal attribute</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
<a b=`c`/>
]]></test>
Expand All @@ -603,6 +606,7 @@ bottles`
<test-case name="string-template-914">
<description>Not allowed in namespace declaration</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
declare namespace xsl=`http://www.w3.org/1999/XSL/Transform`;
<xsl:output/>
Expand All @@ -615,6 +619,7 @@ bottles`
<test-case name="string-template-915">
<description>Not allowed in option declaration</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test><![CDATA[
declare namespace zzz="http://example.com/options";
declare option zzz:synonymous = `http://www.w3.org/1999/XSL/Transform`;
Expand All @@ -637,6 +642,7 @@ bottles`
<test-case name="string-template-917">
<description>Not allowed in decimal format declaration</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test>declare default decimal-format NaN = `not-a-number`; 12</test>
<result>
<error code="XPST0003"/>
Expand All @@ -646,6 +652,7 @@ bottles`
<test-case name="string-template-918">
<description>Not allowed in collation literal</description>
<created by="Michael Kay" on="2023-01-29"/>
<dependency type="spec" value="XQ40+"/>
<test>for $x in (1 to 10)/string() order by $x collation `http://www.w3.org/2005/xpath-functions/collation/codepoint` return xs:integer($x)</test>
<result>
<error code="XPST0003"/>
Expand Down

0 comments on commit c2f1afc

Please sign in to comment.