Skip to content
Open
Show file tree
Hide file tree
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
55 changes: 55 additions & 0 deletions tests/cql/CqlTypesTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,37 @@
</test>
-->
</group>
<group name="Date" version="1.0">
<capability code="types" />
<test name="DateProper" version="1.0">
<capability code="types" />
<expression>@2016-07-07</expression>
<output>@2016-07-07</output>
</test>
<test name="DateYearMonth" version="1.0">
<capability code="types" />
<!-- CQL supports partial date values: https://cql.hl7.org/09-b-cqlreference.html#date -->
<expression>@2014-02</expression>
<output>@2014-02</output>
</test>
<test name="DateYear" version="1.0">
<capability code="types" />
<!-- The date @2014 represents some day in the year 2014: https://cql.hl7.org/09-b-cqlreference.html#date -->
<expression>@2014</expression>
<output>@2014</output>
</test>
<test name="DateMin" version="1.0">
<capability code="types" />
<!-- CQL supports date values in the range @0001-01-01 to @9999-12-31: https://cql.hl7.org/09-b-cqlreference.html#date -->
<expression>@0001-01-01</expression>
<output>@0001-01-01</output>
</test>
<test name="DateMax" version="1.0">
<capability code="types" />
<expression>@9999-12-31</expression>
<output>@9999-12-31</output>
</test>
</group>
<group name="DateTime" version="1.0">
<capability code="types" />
<test name="DateTimeNull" version="1.0">
Expand Down Expand Up @@ -155,6 +186,30 @@
<group name="Interval" version="1.0">
<capability code="types" />
</group>
<group name="Long" version="1.5">
<capability code="types" />
<capability code="system.long" />
<test name="LongProper" version="1.5">
<capability code="types" />
<capability code="system.long" />
<!-- A Long literal is written with an 'L' suffix and may exceed the Integer range: https://cql.hl7.org/09-b-cqlreference.html#long -->
<expression>3000000000L</expression>
<output>3000000000L</output>
</test>
<test name="LongMax" version="1.5">
<capability code="types" />
<capability code="system.long" />
<!-- CQL supports long values in the range -2^63 to 2^63-1: https://cql.hl7.org/09-b-cqlreference.html#long -->
<expression>9223372036854775807L</expression>
<output>9223372036854775807L</output>
</test>
<test name="LongUpperBoundExcept" version="1.5">
<capability code="types" />
<capability code="system.long" />
<!-- 2^63 falls above the accepted upper bound of 2^63-1 for Long: https://cql.hl7.org/09-b-cqlreference.html#long -->
<expression invalid="true">9223372036854775808L</expression>
</test>
</group>
<group name="Quantity" version="1.0">
<capability code="types" />
<test name="QuantityTest" version="1.0">
Expand Down
68 changes: 63 additions & 5 deletions tests/cql/ValueLiteralsAndSelectors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,17 @@
<group name="String" version="1.0">
<capability code="literals"/>
<!-- Note: See also Translator test files such as EscapeSequenceTests.cql -->
<!-- TODO: Add tests here. -->
<test name="StringSimple" version="1.0">
<capability code="literals"/>
<expression>'Hello, World!'</expression>
<output>'Hello, World!'</output>
</test>
<test name="StringEmpty" version="1.0">
<capability code="literals"/>
<!-- The empty string is a valid String literal: https://cql.hl7.org/03-developersguide.html#string -->
<expression>''</expression>
<output>''</output>
</test>
</group>
<!-- CQL spec section 3.1.3 Literals:
DateTime - The at-symbol (@) followed by an ISO-8601 compliant representation of a date/time -->
Expand All @@ -389,7 +399,22 @@
<group name="DateTime" version="1.0">
<capability code="literals"/>
<!-- Note: See also Translator test files such as DateTimeLiteralTest.cql -->
<!-- TODO: Add tests here. -->
<test name="DateTimeDatePrecision" version="1.0">
<capability code="literals"/>
<!-- A DateTime literal may be specified to day precision, indicated by the trailing 'T': https://cql.hl7.org/03-developersguide.html#datetime -->
<expression>@2015-02-04T</expression>
<output>@2015-02-04T</output>
</test>
<test name="DateTimeMinutePrecision" version="1.0">
<capability code="literals"/>
<expression>@2015-02-04T14:30</expression>
<output>@2015-02-04T14:30</output>
</test>
<test name="DateTimeMillisecondPrecision" version="1.0">
<capability code="literals"/>
<expression>@2015-02-04T14:30:25.900</expression>
<output>@2015-02-04T14:30:25.900</output>
</test>
</group>
<!-- CQL spec section 3.1.3 Literals:
Time - The at-symbol (@) followed by an ISO-8601 compliant representation of a time -->
Expand All @@ -398,15 +423,48 @@
<group name="Time" version="1.0">
<capability code="literals"/>
<!-- Note: See also Translator test files such as DateTimeLiteralTest.cql -->
<!-- TODO: Add tests here. -->
<test name="TimeMinutePrecision" version="1.0">
<capability code="literals"/>
<expression>@T14:30</expression>
<output>@T14:30</output>
</test>
<test name="TimeMillisecondPrecision" version="1.0">
<capability code="literals"/>
<expression>@T14:30:25.900</expression>
<output>@T14:30:25.900</output>
</test>
</group>
<group name="List" version="1.0">
<capability code="literals"/>
<!-- TODO: Add tests here. -->
<test name="ListInteger" version="1.0">
<capability code="literals"/>
<expression>{4, 5, 6}</expression>
<output>{4, 5, 6}</output>
</test>
<test name="ListString" version="1.0">
<capability code="literals"/>
<expression>{'a', 'b', 'c'}</expression>
<output>{'a', 'b', 'c'}</output>
</test>
<test name="ListWithNull" version="1.0">
<capability code="literals"/>
<!-- A list may contain null elements: https://cql.hl7.org/03-developersguide.html#list-values -->
<expression>{1, null, 3}</expression>
<output>{1, null, 3}</output>
</test>
</group>
<group name="Interval" version="1.0">
<capability code="literals"/>
<!-- TODO: Add tests here. -->
<test name="IntervalInteger" version="1.0">
<capability code="literals"/>
<expression>Interval[1, 10]</expression>
<output>Interval[1, 10]</output>
</test>
<test name="IntervalDecimal" version="1.0">
<capability code="literals"/>
<expression>Interval[1.0, 10.0]</expression>
<output>Interval[1.0, 10.0]</output>
</test>
</group>
<group name="Tuple" version="1.0">
<capability code="literals"/>
Expand Down
Loading