Skip to content

Commit

Permalink
Merge pull request #99 from michaelhkay/Misc-coverage-tagging
Browse files Browse the repository at this point in the history
Add coverage tags identifying PRs; add tests for array:values
  • Loading branch information
michaelhkay authored Mar 19, 2024
2 parents 9ea7f9b + 628b5fa commit 1e2536f
Show file tree
Hide file tree
Showing 15 changed files with 282 additions and 219 deletions.
7 changes: 3 additions & 4 deletions array/index-of.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="us-ascii"?>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="array-index-of" covers-40="array-index-of">
<description>Tests for the array:index-of() function (4.0 proposal)</description>
<link type="spec" document="http://www.w3.org/TR/xpath-functions-30/" idref="func-array-index-of"/>

<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="array-index-of" covers-40="PR968">
<description>Tests for the array:index-of() function (4.0)</description>

<dependency type="spec" value="XP40+ XQ40+"/>

<test-case name="array-index-of-001">
Expand Down
71 changes: 0 additions & 71 deletions array/of.xml

This file was deleted.

85 changes: 85 additions & 0 deletions array/values.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="us-ascii"?>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="array-values" covers-40="PR476">
<description>Tests for the XPath 4.0 array:values() function</description>


<dependency type="spec" value="XP40+ XQ40+"/>

<test-case name="array-values-001">
<description> Deconstruct an empty array </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values([])</test>
<result>
<assert-empty/>
</result>
</test-case>

<test-case name="array-values-002">
<description> Deconstruct a singleton array </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values([1])</test>
<result>
<assert-eq>1</assert-eq>
</result>
</test-case>

<test-case name="array-values-003">
<description> Deconstruct a more complex array </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values([1, (2,3)])</test>
<result>
<assert-count>3</assert-count>
</result>
</test-case>

<test-case name="array-values-004">
<description> Deconstruct a more complex array </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values([1, (2,3)])</test>
<result>
<assert-deep-eq>1, 2, 3</assert-deep-eq>
</result>
</test-case>

<test-case name="array-values-005">
<description> Deconstruct a more complex array </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values([1, (2,3), ()])</test>
<result>
<assert-deep-eq>1, 2, 3</assert-deep-eq>
</result>
</test-case>

<test-case name="array-values-006">
<description> Not recursive </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values([1, [2,3], []])</test>
<result>
<assert-deep-eq>1, [2,3], []</assert-deep-eq>
</result>
</test-case>

<test-case name="array-values-901">
<description> Argument must not be empty sequence </description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values(())</test>
<result>
<error code="XPTY0004"/>
</result>
</test-case>

<test-case name="array-values-902">
<description> Argument must not be sequence of arrays</description>
<created by="Michael Kay" on="2024-03-15"/>
<test>array:values(([1], [2]))</test>
<result>
<error code="XPTY0004"/>
</result>
</test-case>






</test-set>
1 change: 1 addition & 0 deletions catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
<test-set name="array-subarray" file="array/subarray.xml"/>
<test-set name="array-tail" file="array/tail.xml"/>
<test-set name="array-trunk" file="array/trunk.xml"/>
<test-set name="array-values" file="array/values.xml"/>

<!-- Some tests for characteristics of xs: data types. -->

Expand Down
8 changes: 4 additions & 4 deletions fn/distinct-values.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@
</result>
</test-case>

<test-case name="distinct-values-401" covers-40="keywords">
<test-case name="distinct-values-401" covers-40="PR590">
<description> Collation set to () </description>
<created by="Michael Kay" on="2023-07-04"/>
<dependency type="spec" value="XP40+ XQ40+"/>
Expand All @@ -1343,7 +1343,7 @@
</result>
</test-case>

<test-case name="distinct-values-402" covers-40="keywords">
<test-case name="distinct-values-402" covers-40="PR590">
<description> Collation set to () </description>
<created by="Michael Kay" on="2023-07-04"/>
<dependency type="spec" value="XP40+ XQ40+"/>
Expand All @@ -1353,7 +1353,7 @@
</result>
</test-case>

<test-case name="distinct-values-403" covers-40="keywords">
<test-case name="distinct-values-403" covers-40="PR590">
<description> Collation set to () dynamically </description>
<created by="Michael Kay" on="2023-07-04"/>
<dependency type="spec" value="XP40+ XQ40+"/>
Expand All @@ -1363,7 +1363,7 @@
</result>
</test-case>

<test-case name="distinct-values-404">
<test-case name="distinct-values-404" changes-40="PR987">
<description>In 4.0 order of results is predictable (assumes ordering mode = ordered)</description>
<created by="Michael Kay" on="2024-01-31"/>
<dependency type="spec" value="XP40+ XQ40+"/>
Expand Down
14 changes: 6 additions & 8 deletions fn/duplicate-values.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0"?>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-duplicate-values" covers-40="fn-duplicate-values">
<description>Tests for the duplicate-values() function</description>
<link type="spec" document="http://www.w3.org/TR/xpath-functions-30/"
idref="func-duplicate-values"/>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-duplicate-values" covers-40="PR614">
<description>Tests for the duplicate-values() function (4.0)</description>

<dependency type="spec" value="XP40+ XQ40+"/>

Expand Down Expand Up @@ -1303,7 +1301,7 @@ duplicate-values(
</result>
</test-case>

<test-case name="duplicate-values-401" covers-40="keywords">
<test-case name="duplicate-values-401" covers-40="PR590">
<description> Collation set to () </description>
<created by="Michael Kay" on="2023-07-18"/>
<test>fn:duplicate-values(("a", "a"), ())</test>
Expand All @@ -1312,7 +1310,7 @@ duplicate-values(
</result>
</test-case>

<test-case name="duplicate-values-402" covers-40="keywords">
<test-case name="duplicate-values-402" covers-40="PR590">
<description> Collation set to () </description>
<created by="Michael Kay" on="2023-07-18"/>
<test>count(fn:duplicate-values(("a", "b", "a"), collation:=()))</test>
Expand All @@ -1321,7 +1319,7 @@ duplicate-values(
</result>
</test-case>

<test-case name="duplicate-values-403" covers-40="keywords">
<test-case name="duplicate-values-403" covers-40="PR590">
<description> Collation set to () dynamically </description>
<created by="Michael Kay" on="2023-07-18"/>
<test>count(fn:duplicate-values(("a", "b", "a"), collation:="xyz"[current-date() lt xs:date('1999-01-01')]))</test>
Expand All @@ -1330,7 +1328,7 @@ duplicate-values(
</result>
</test-case>

<test-case name="duplicate-values-404">
<test-case name="duplicate-values-404" changes-40="PR987">
<description>Order of results is predictable (assumes ordering mode = ordered)</description>
<created by="Michael Kay" on="2024-01-31"/>
<dependency type="spec" value="XP40+ XQ40+"/>
Expand Down
6 changes: 2 additions & 4 deletions fn/seconds.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-seconds">
<description>Tests for the seconds() function</description>
<link type="spec" document="http://www.w3.org/TR/xpath-functions-30/"
idref="func-seconds"/>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="PR984">
<description>Tests for the seconds() function (4.0)</description>

<dependency type="spec" value="XP40+ XQ40+"/>

Expand Down
3 changes: 1 addition & 2 deletions fn/sort-with.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-sort-with" covers-40="fn-sort-with">
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-sort-with" covers-40="PR795">
<description>Tests for the fn:sort-with function</description>
<link type="spec" document="http://www.w3.org/TR/xpath-functions-30/" idref="func-sort-with"/>
<dependency type="spec" value="XP40+ XQ40+"/>

<test-case name="sort-with-001">
Expand Down
6 changes: 2 additions & 4 deletions fn/subsequence-where.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="us-ascii"?>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-subsequence-where" covers-40="PR940">
<description>Tests for the fn:subsequence-where function (4.0 proposal)</description>
<link type="spec" document="http://www.w3.org/TR/xpath-functions-11/"
idref="func-subsequence-where"/>
<description>Tests for the fn:subsequence-where function (4.0)</description>

<dependency type="spec" value="XP40+ XQ40+"/>
<dependency type="spec" value="XP40+ XQ40+"/>

<test-case name="subsequence-after-001">
<description>Basic example</description>
Expand Down
13 changes: 5 additions & 8 deletions fn/void.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-void" covers-40="fn-void">
<description>Tests for the fn:log() function (4.0 proposal)</description>
<link type="spec" document="http://www.w3.org/TR/xquery-30/"
idref="doc-xquery30-QuantifiedExpr"/>
<link type="spec" document="XQuery" section-number="3.11"
idref="id-quantified-expressions"/>
<test-set xmlns="http://www.w3.org/2010/09/qt-fots-catalog" name="fn-void" covers-40="PR575">
<description>Tests for the fn:void() function (4.0)</description>



<dependency type="spec" value="XP40+ XQ40+"/>
Expand Down Expand Up @@ -42,7 +39,7 @@
</result>
</test-case>

<test-case name="void-004">
<test-case name="void-004" covers-40="PR1032">
<description> Use void#0 function item </description>
<created by="Michael Kay" on="2024-02-20"/>
<test>(1 to 10) => for-each(if (current-date() lt xs:date('1900-01-01'))
Expand All @@ -53,7 +50,7 @@
</result>
</test-case>

<test-case name="void-005">
<test-case name="void-005" covers-40="PR1032">
<description> Direct call on void#0 </description>
<created by="Michael Kay" on="2024-02-20"/>
<test>empty(void())</test>
Expand Down
Loading

0 comments on commit 1e2536f

Please sign in to comment.