Skip to content

Commit

Permalink
assertions for input and output values unary tests in decision tables
Browse files Browse the repository at this point in the history
  • Loading branch information
StrayAlien committed Jul 26, 2024
1 parent 958880d commit dcb3093
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@
</resultNode>
</testCase>

<testCase id="008_b">
<!-- further to 008, an input expression of boolean "false" will not be satisfied against a rule
unary test of that evaluates to true -->
<description>input values: boolean expression is weird</description>
<resultNode name="decision008_b" type="decision">
<expected>
<value xsi:type="xsd:string">success</value>
</expected>
</resultNode>
</testCase>

<testCase id="009">
<description>output values: result satisfies output values</description>
<resultNode name="decision009" type="decision">
Expand Down Expand Up @@ -205,4 +216,13 @@
</resultNode>
</testCase>

<testCase id="017">
<description>input values: ? used in expression outside of unary tests expressions</description>
<resultNode name="decision017" type="decision">
<expected>
<value xsi:type="xsd:string">success</value>
</expected>
</resultNode>
</testCase>

</testCases>
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@

<decision name="decision006_b" id="_decision006_b">
<!-- '?' symbol -->
<!-- input expression "foo" executed against "?" does not return true and thus the rule for null will be satisfied -->
<!-- spec states that an expression with "?" must return a boolean "true" for it to be satisfied -->
<!-- input expression "foo" executed against "?" does not return true but, does satisfy an equality check -->
<variable name="decision006_b"/>
<decisionTable>
<input>
Expand All @@ -206,7 +205,7 @@
<output/>
<rule>
<inputEntry>
<text>null</text>
<text>"foo"</text>
</inputEntry>
<outputEntry>
<text>"success"</text>
Expand Down Expand Up @@ -241,6 +240,32 @@
</decisionTable>
</decision>

<decision name="decision006_d" id="_decision006_d">
<!-- '?' symbol -->
<!-- input expression `false` executed against "?" returns false and thus an equality check is satisfied -->
<!-- spec states that an expression with "?" must return a boolean "true" for it to be satisfied -->
<variable name="decision006_d"/>
<decisionTable>
<input>
<inputExpression>
<text>false</text>
</inputExpression>
<inputValues>
<text>?</text>
</inputValues>
</input>
<output/>
<rule>
<inputEntry>
<text>false</text>
</inputEntry>
<outputEntry>
<text>"success"</text>
</outputEntry>
</rule>
</decisionTable>
</decision>

<decision name="decision007" id="_decision007">
<!-- input expression is valid against input values - input value has no text-->
<!-- spec says text is optional -->
Expand Down Expand Up @@ -324,6 +349,32 @@
</decisionTable>
</decision>

<decision name="decision008_b" id="_decision008_b">
<!-- Odd handling for boolean. 'true' is an expression. Unary tests permit expressions but
in this case the input expression false will not satisfy unary tests and thus the
rule for null will be satisfied -->
<variable name="decision008_b"/>
<decisionTable>
<input>
<inputExpression>
<text>false</text>
</inputExpression>
<inputValues>
<text>1==1</text>
</inputValues>
</input>
<output/>
<rule>
<inputEntry>
<text>null</text>
</inputEntry>
<outputEntry>
<text>"success"</text>
</outputEntry>
</rule>
</decisionTable>
</decision>

<decision name="decision009" id="_decision009">
<!-- table result satisfies output values -->
<variable name="decision009"/>
Expand Down Expand Up @@ -524,12 +575,11 @@
<inputExpression>
<text>123</text>
</inputExpression>
</input>
<output>
<outputValues>
<inputValues>
<text>string length(?) >= 3</text>
</outputValues>
</output>
</inputValues>
</input>
<output/>
<rule>
<inputEntry>
<text>123</text>
Expand All @@ -541,5 +591,29 @@
</decisionTable>
</decision>

<decision name="decision017" id="_decision017">
<!-- ? is used in an expression, but is not one of the unary tests expressions -->
<variable name="decision017"/>
<decisionTable>
<input>
<inputExpression>
<text>123</text>
</inputExpression>
<inputValues>
<text>[345, ? = 123, 456]</text>
</inputValues>
</input>
<output/>
<rule>
<inputEntry>
<text>null</text>
</inputEntry>
<outputEntry>
<text>"success"</text>
</outputEntry>
</rule>
</decisionTable>
</decision>

</definitions>

0 comments on commit dcb3093

Please sign in to comment.