Skip to content

Commit

Permalink
changed assertions on equality checks between unary comparison range …
Browse files Browse the repository at this point in the history
…and normal ranges to be in line with 1.5. Added a few additional tests for unary comparison range equality.
  • Loading branch information
StrayAlien committed Jul 25, 2024
1 parent 4aa5ea5 commit b2bcec5
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1105,51 +1105,77 @@
</testCase>

<testCase id="range_006">
<description>equal ranges though syntactically different: LT </description>
<inputNode name="null_input">
<value xsi:nil="true"/>
</inputNode>
<description>equal ranges though syntactically different are not equal: LT </description>
<resultNode name="range_006" type="decision">
<expected>
<value xsi:type="xsd:boolean">false</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_006_a">
<description>unary syntax comparison range LT</description>
<resultNode name="range_006_a" type="decision">
<expected>
<value xsi:type="xsd:boolean">true</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_007">
<description>equal ranges though syntactically different: LE </description>
<inputNode name="null_input">
<value xsi:nil="true"/>
</inputNode>
<description>equal ranges though syntactically different are not equal: LE </description>
<resultNode name="range_007" type="decision">
<expected>
<value xsi:type="xsd:boolean">true</value>
<value xsi:type="xsd:boolean">false</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_008">
<description>equal ranges though syntactically different: GT </description>
<inputNode name="null_input">
<value xsi:nil="true"/>
</inputNode>
<description>equal ranges though syntactically different are not equal: GT </description>
<resultNode name="range_008" type="decision">
<expected>
<value xsi:type="xsd:boolean">true</value>
<value xsi:type="xsd:boolean">false</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_009">
<description>equal ranges though syntactically different: GE </description>
<inputNode name="null_input">
<value xsi:nil="true"/>
</inputNode>
<description>equal ranges though syntactically different are not equal: GE </description>
<resultNode name="range_009" type="decision">
<expected>
<value xsi:type="xsd:boolean">false</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_010">
<description>equal ranges though syntactically different are not equal: EQ </description>
<resultNode name="range_010" type="decision">
<expected>
<value xsi:type="xsd:boolean">false</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_011">
<description>unary syntax comparison range EQ</description>
<resultNode name="range_011" type="decision">
<expected>
<value xsi:type="xsd:boolean">true</value>
</expected>
</resultNode>
</testCase>

<testCase id="range_012">
<description>unary syntax comparison range NE</description>
<resultNode name="range_012" type="decision">
<expected>
<value xsi:type="xsd:boolean">true</value>
</expected>
</resultNode>
</testCase>



</testCases>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
>
<description>FEEL equality</description>

<inputData name="null_input" id="_null_input">
<variable name="null_input" typeRef="Any"/> <!-- some test cases always supply value `null` for this InputData -->
</inputData>

<decision name="null_001" id="_null_001">
<description>Tests FEEL expression: 'null = null' and expects result: 'true (boolean)'</description>
<question>Result of FEEL expression 'null = null'?</question>
Expand Down Expand Up @@ -1263,62 +1259,82 @@
</decision>

<decision name="range_006" id="_range_006">
<description>Tests FEEL expression: "(&lt; 10) = (null_input..10)" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(&lt; 10) = (null_input..10)'?</question>
<allowedAnswers>true (boolean)</allowedAnswers>
<description>Tests FEEL expression: "(&lt; 10) = (null..10)" and expects result: 'false (boolean)'</description>
<question>Tests FEEL expression: '(&lt; 10) = (null..10)'?</question>
<allowedAnswers>false (boolean)</allowedAnswers>
<variable name="range_006"/>
<!-- to provide null as a range endpoint. As at DMN 1.3, a literal null is
not grammatically permitted -->
<informationRequirement>
<requiredInput href="#_null_input"/>
</informationRequirement>
<literalExpression>
<text>(&lt; 10) = (null_input..10)</text>
<text>(&lt; 10) = (null..10)</text>
</literalExpression>
</decision>

<decision name="range_007" id="_range_007">
<description>Tests FEEL expression: "(&lt;= 10) = (null_input..10]" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(&lt;= 10) = (null_input..10]'?</question>
<decision name="range_006_a" id="_range_006_a">
<description>Tests FEEL expression: "(&lt; 10) = (&lt; 10)" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(&lt; 10) = (&lt; 10)'?</question>
<allowedAnswers>true (boolean)</allowedAnswers>
<variable name="range_006_a"/>
<literalExpression>
<text>(&lt; 10) = (&lt; 10)</text>
</literalExpression>
</decision>

<decision name="range_007" id="_range_007">
<description>Tests FEEL expression: "(&lt;= 10) = (null..10]" and expects result: 'false (boolean)'</description>
<question>Tests FEEL expression: '(&lt;= 10) = (null..10]'?</question>
<allowedAnswers>false (boolean)</allowedAnswers>
<variable name="range_007"/>
<!-- to provide null as a range endpoint. As at DMN 1.3, a literal null is
not grammatically permitted -->
<informationRequirement>
<requiredInput href="#_null_input"/>
</informationRequirement>
<literalExpression>
<text>(&lt;= 10) = (null_input..10]</text>
<text>(&lt;= 10) = (null..10]</text>
</literalExpression>
</decision>

<decision name="range_008" id="_range_008">
<description>Tests FEEL expression: "(&gt; 10) = (10..null_input)" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(&gt; 10) = (10..null_input)'?</question>
<allowedAnswers>true (boolean)</allowedAnswers>
<description>Tests FEEL expression: "(&gt; 10) = (10..null)" and expects result: 'false (boolean)'</description>
<question>Tests FEEL expression: '(&gt; 10) = (10..null)'?</question>
<allowedAnswers>false (boolean)</allowedAnswers>
<variable name="range_008"/>
<!-- to provide null as a range endpoint. As at DMN 1.3, a literal null is
not grammatically permitted -->
<informationRequirement>
<requiredInput href="#_null_input"/>
</informationRequirement>
<literalExpression>
<text>(&gt; 10) = (10..null_input)</text>
<text>(&gt; 10) = (10..null)</text>
</literalExpression>
</decision>

<decision name="range_009" id="_range_009">
<description>Tests FEEL expression: "(&gt;= 10) = [10..null_input)" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(&gt;= 10) = [10..null_input)'?</question>
<allowedAnswers>true (boolean)</allowedAnswers>
<description>Tests FEEL expression: "(&gt;= 10) = [10..null)" and expects result: 'false (boolean)'</description>
<question>Tests FEEL expression: '(&gt;= 10) = [10..null)'?</question>
<allowedAnswers>false (boolean)</allowedAnswers>
<variable name="range_009"/>
<!-- to provide null as a range endpoint. As at DMN 1.3, a literal null is
not grammatically permitted -->
<informationRequirement>
<requiredInput href="#_null_input"/>
</informationRequirement>
<literalExpression>
<text>(&gt;= 10) = [10..null_input)</text>
<text>(&gt;= 10) = [10..null)</text>
</literalExpression>
</decision>

<decision name="range_010" id="_range_010">
<description>Tests FEEL expression: "(=10) = [10..10]" and expects result: 'false (boolean)'</description>
<question>Tests FEEL expression: '(=10) = [10..10]'?</question>
<allowedAnswers>false (boolean)</allowedAnswers>
<variable name="range_010"/>
<literalExpression>
<text>(=10) = [10..10]</text>
</literalExpression>
</decision>

<decision name="range_011" id="_range_011">
<description>Tests FEEL expression: "(=10) = (=10)" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(=10) = (=10)'?</question>
<allowedAnswers>true (boolean)</allowedAnswers>
<variable name="range_011"/>
<literalExpression>
<text>(=10) = (=10)</text>
</literalExpression>
</decision>

<decision name="range_012" id="_range_012">
<description>Tests FEEL expression: "(!=10) = (!=10)" and expects result: 'true (boolean)'</description>
<question>Tests FEEL expression: '(!=10) = (!=10)'?</question>
<allowedAnswers>true (boolean)</allowedAnswers>
<variable name="range_012"/>
<literalExpression>
<text>(!=10) = (!=10)</text>
</literalExpression>
</decision>

Expand Down

0 comments on commit b2bcec5

Please sign in to comment.