Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 59 additions & 20 deletions tests/cql/CqlListOperatorsTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@
</test>
<test name="EqualABCAnd123" version="1.0">
<capability code="list-operators" />
<expression>{ 'a', 'b', 'c' } as List&lt;Any&gt; ~ { 1, 2, 3 } as List&lt;Any&gt;</expression>
<!-- corrected: was using ~ (equivalent) inside the Equal group -->
<expression>{ 'a', 'b', 'c' } as List&lt;Any&gt; = { 1, 2, 3 } as List&lt;Any&gt;</expression>
<output>false</output>
</test>
<test name="Equal123AndABC" version="1.0">
Expand Down Expand Up @@ -275,6 +276,12 @@
<expression>{ 1, 4 } except null</expression>
<output>{1, 4}</output>
</test>
<test name="ExceptNullLeft" version="1.0">
<capability code="list-operators" />
<!-- first argument null -> null -->
<expression>(null as List&lt;Integer&gt;) except { 1, 3, 5 }</expression>
<output>null</output>
</test>
</group>
<group name="Exists" version="1.0">
<capability code="list-operators" />
Expand Down Expand Up @@ -341,6 +348,11 @@
<expression>Flatten({ {@T15:59:59.999}, {@T20:59:59.999} })</expression>
<output>{ @T15:59:59.999, @T20:59:59.999 }</output>
</test>
<test name="FlattenNull" version="1.0">
<capability code="list-operators" />
<expression>Flatten(null as List&lt;List&lt;Integer&gt;&gt;)</expression>
<output>null</output>
</test>
</group>
<group name="First" version="1.0">
<capability code="list-operators" />
Expand Down Expand Up @@ -374,6 +386,11 @@
<expression>First({ @T15:59:59.999, @T20:59:59.999 })</expression>
<output>@T15:59:59.999</output>
</test>
<test name="FirstNull" version="1.0">
<capability code="list-operators" />
<expression>First(null as List&lt;Integer&gt;)</expression>
<output>null</output>
</test>
</group>
<group name="In" version="1.0">
<capability code="list-operators" />
Expand Down Expand Up @@ -475,10 +492,9 @@
<expression>null as List&lt;Integer&gt; includes {2}</expression>
<output>null</output>
</test>
<!-- this test is going to the ContainsEvaluator -->
<test name="IncludesNullRight" version="1.0">
<capability code="list-operators" />
<expression>{'s', 'a', 'm'} includes null</expression>
<expression>{'s', 'a', 'm'} includes null as List&lt;String&gt;</expression>
<output>null</output>
</test>
</group>
Expand Down Expand Up @@ -529,10 +545,9 @@
<expression>@T16:59:59.999 included in { @T02:29:15.156, @T15:59:59.999, @T20:59:59.999 }</expression>
<output>false</output>
</test>
<!-- the following expression is going to the InEvaluator -->
<test name="IncludedInNullLeft" version="1.0">
<capability code="list-operators" />
<expression>null included in {2}</expression>
<expression>null as List&lt;Integer&gt; included in {2}</expression>
<output>null</output>
</test>
<test name="IncludedInNullRight" version="1.0">
Expand Down Expand Up @@ -650,6 +665,12 @@
<expression>{ @T02:29:15.156, @T15:59:59.999, @T20:59:59.999 } intersect { @T01:29:15.156, @T15:59:59.999, @T20:59:59.999 }</expression>
<output>{@T15:59:59.999, @T20:59:59.999}</output>
</test>
<test name="IntersectNull" version="1.0">
<capability code="list-operators" />
<!-- either argument null -> null -->
<expression>{ 1, 3, 5 } intersect (null as List&lt;Integer&gt;)</expression>
<output>null</output>
</test>
</group>
<group name="Last" version="1.0">
<capability code="list-operators" />
Expand Down Expand Up @@ -835,12 +856,13 @@
</test>
<test name="NotEqualTimeTrue" version="1.0">
<capability code="list-operators" />
<expression>{ @T15:59:59.999, @T20:59:59.999 } = { @T15:59:59.999, @T20:59:59.999 }</expression>
<!-- corrected: was using = instead of != -->
<expression>{ @T15:59:59.999, @T20:59:59.999 } != { @T15:59:59.999, @T20:59:49.999 }</expression>
<output>true</output>
</test>
<test name="NotEqualTimeFalse" version="1.0">
<capability code="list-operators" />
<expression>{ @T15:59:59.999, @T20:59:59.999 } = { @T15:59:59.999, @T20:59:49.999 }</expression>
<expression>{ @T15:59:59.999, @T20:59:59.999 } != { @T15:59:59.999, @T20:59:59.999 }</expression>
<output>false</output>
</test>
</group>
Expand Down Expand Up @@ -868,17 +890,17 @@
</test>
<test name="ProperContainsNullRightFalse" version="1.0">
<capability code="list-operators" />
<expression>{'s', 'u', 'n'} properly includes null</expression>
<expression>{'s', 'u', 'n'} properly includes null as String</expression>
<output>false</output>
</test>
<test name="ProperContains5" version="1.0">
<capability code="list-operators" />
<expression>{ null, null } properly includes null as String</expression>
<output>false</output>
<output>true</output>
</test>
<test name="ProperContainsNullRightTrue" version="1.0">
<capability code="list-operators" />
<expression>{'s', 'u', 'n', null} properly includes null</expression>
<expression>{'s', 'u', 'n', null} properly includes null as String</expression>
<output>true</output>
</test>
<test name="ProperContains6" version="1.0">
Expand All @@ -889,7 +911,7 @@
<test name="ProperContains7" version="1.0">
<capability code="list-operators" />
<expression>{ 'a', 'a' } properly includes 'a'</expression>
<output>false</output>
<output>true</output>
</test>
<test name="ProperContains8" version="1.0">
<capability code="list-operators" />
Expand All @@ -899,7 +921,7 @@
<test name="ProperContains9" version="1.0">
<capability code="list-operators" />
<expression>{ 'a', null } properly includes 'a'</expression>
<output>null</output>
<output>true</output>
</test>
<test name="ProperContains10" version="1.0">
<capability code="list-operators" />
Expand All @@ -914,7 +936,7 @@
<test name="ProperContainsTimeNull" version="1.0">
<capability code="list-operators" />
<expression>{ @T15:59:59.999, @T20:59:59.999, @T20:59:49.999 } properly includes @T15:59:59</expression>
<output>null</output>
<output>false</output>
</test>
</group>
<group name="ProperIn" version="1.0">
Expand All @@ -941,13 +963,13 @@
</test>
<test name="ProperInNullRightFalse" version="1.0">
<capability code="list-operators" />
<expression>null properly included in {'s', 'u', 'n'}</expression>
<expression>null as String properly included in {'s', 'u', 'n'}</expression>
<output>false</output>
</test>
<test name="ProperIn5" version="1.0">
<capability code="list-operators" />
<expression>null as String properly included in { null, null }</expression>
<output>false</output>
<output>true</output>
</test>
<test name="ProperInNullRightTrue" version="1.0">
<capability code="list-operators" />
Expand All @@ -962,7 +984,7 @@
<test name="ProperIn7" version="1.0">
<capability code="list-operators" />
<expression>'a' properly included in { 'a', 'a' }</expression>
<output>false</output>
<output>true</output>
</test>
<test name="ProperIn8" version="1.0">
<capability code="list-operators" />
Expand All @@ -972,7 +994,7 @@
<test name="ProperIn9" version="1.0">
<capability code="list-operators" />
<expression>'a' properly included in { 'a', null }</expression>
<output>null</output>
<output>true</output>
</test>
<test name="ProperIn10" version="1.0">
<capability code="list-operators" />
Expand All @@ -987,7 +1009,7 @@
<test name="ProperInTimeNull" version="1.0">
<capability code="list-operators" />
<expression>@T15:59:59 properly included in { @T15:59:59.999, @T20:59:59.999, @T20:59:49.999 }</expression>
<output>null</output>
<output>false</output>
</test>
</group>
<group name="ProperlyIncludes" version="1.0">
Expand Down Expand Up @@ -1039,7 +1061,7 @@
</test>
<test name="ProperlyIncludesNullLeft" version="1.0">
<capability code="list-operators" />
<expression>null properly includes {2}</expression>
<expression>null as List&lt;Integer&gt; properly includes {2}</expression>
<output>null</output>
</test>
</group>
Expand Down Expand Up @@ -1092,7 +1114,7 @@
</test>
<test name="ProperlyIncludedInNulRight" version="1.0">
<capability code="list-operators" />
<expression>{'s', 'u', 'n'} properly included in null</expression>
<expression>{'s', 'u', 'n'} properly included in null as List&lt;String&gt;</expression>
<output>null</output>
</test>
</group>
Expand Down Expand Up @@ -1128,6 +1150,11 @@
<expression>singleton from { @T15:59:59.999 }</expression>
<output>@T15:59:59.999</output>
</test>
<test name="SingletonFromNull" version="1.0">
<capability code="list-operators" />
<expression>singleton from (null as List&lt;Integer&gt;)</expression>
<output>null</output>
</test>
</group>
<group name="Skip" version="1.0">
<capability code="list-operators" />
Expand Down Expand Up @@ -1156,6 +1183,18 @@
<expression>Skip({1,2,3,4,5}, 5)</expression>
<output>{}</output>
</test>
<test name="SkipNullNumber" version="1.0">
<capability code="list-operators" />
<!-- null number -> entire list -->
<expression>Skip({ 1, 2, 3 }, null as Integer)</expression>
<output>{ 1, 2, 3 }</output>
</test>
<test name="SkipNegative" version="1.0">
<capability code="list-operators" />
<!-- negative number -> empty list -->
<expression>Skip({ 1, 2, 3 }, -1)</expression>
<output>{ }</output>
</test>
</group>
<group name="Slice" version="2.0" reference="http://cql.hl7.org/09-b-cqlreference.html#slice">
<capability code="list-operators" />
Expand Down
Loading