Skip to content

Commit

Permalink
Map construction, minor edits. qt4cg/qtspecs#1740
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGruen committed Jan 30, 2025
1 parent b64d570 commit 018d2b0
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions map/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@
<test-case name="map-build-006">
<description>duplicates option</description>
<created by="Michael Kay, Saxonica" on="2025-01-29"/>
<modified by="Christian Gruen" on="2025-01-30" change="Implementation-dependent key handling"/>
<test>
map:build((1, 2, 3, 1.0e0), options:={'duplicates':'use-first'})
</test>
<result>
<all-of>
<assert-deep-eq>{1:1, 2:2, 3:3}</assert-deep-eq>
<assert>deep-equal(map:keys($result), (1, 2, 3))</assert>
<assert>map:keys($result)[1] instance of xs:double</assert>
<assert>map:values($result)[1] instance of xs:integer</assert>
<assert>map:keys($result)[1] instance of xs:numeric</assert>
<assert>map:items($result)[1] instance of xs:integer</assert>
</all-of>
</result>
</test-case>
Expand All @@ -99,9 +100,9 @@
<all-of>
<assert-deep-eq>{1:1, 2:2, 3:3}</assert-deep-eq>
<assert>deep-equal(map:keys($result), (1, 2, 3))</assert>
<assert>deep-equal(map:values($result), (1, 2, 3))</assert>
<assert>deep-equal(map:items($result), (1, 2, 3))</assert>
<assert>map:keys($result)[1] instance of xs:double</assert>
<assert>map:values($result)[1] instance of xs:double</assert>
<assert>map:items($result)[1] instance of xs:double</assert>
</all-of>
</result>
</test-case>
Expand All @@ -116,9 +117,9 @@
<all-of>
<assert-deep-eq>{1:1, 2:2, 3:3}</assert-deep-eq>
<assert>deep-equal(map:keys($result), (1, 2, 3))</assert>
<assert>deep-equal(map:values($result), (1, 2, 3))</assert>
<assert>deep-equal(map:items($result), (1, 2, 3))</assert>
<assert>map:keys($result)[1] instance of xs:double</assert>
<assert>map:values($result)[1] instance of xs:numeric</assert>
<assert>map:items($result)[1] instance of xs:numeric</assert>
</all-of>
</result>
</test-case>
Expand All @@ -133,9 +134,9 @@
<all-of>
<assert-deep-eq>{1:(1, 1e0), 2:2, 3:3}</assert-deep-eq>
<assert>deep-equal(map:keys($result), (1, 2, 3))</assert>
<assert>deep-equal(map:values($result), (1, 1.0e0, 2, 3))</assert>
<assert>deep-equal(map:items($result), (1, 1.0e0, 2, 3))</assert>
<assert>map:keys($result)[1] instance of xs:double</assert>
<assert>map:values($result)[1] instance of xs:numeric</assert>
<assert>map:items($result)[1] instance of xs:numeric</assert>
</all-of>
</result>
</test-case>
Expand All @@ -154,11 +155,15 @@
<test-case name="map-build-011">
<description>duplicates option, invalid</description>
<created by="Michael Kay, Saxonica" on="2025-01-29"/>
<modified by="Christian Gruen" on="2025-01-30" change="Error code added to allow enum check"/>
<test>
map:build((1, 2, 3, 1.0e0), options:={'duplicates':'invalid'})
</test>
<result>
<error code="FOJS0005"/>
<any-of>
<error code="XPTY0004"/>
<error code="FOJS0005"/>
</any-of>
</result>
</test-case>

Expand Down Expand Up @@ -445,7 +450,7 @@
</result>
</test-case>

<test-case name="map-build-121" covers-40="PR1703">
<test-case name="map-build-121a" covers-40="PR1703">
<description>Order is retained</description>
<created by="Michael Kay, Saxonica" on="2025-01-22"/>
<environment ref="map"/>
Expand Down

0 comments on commit 018d2b0

Please sign in to comment.