Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMN 1.4 - 1152-boxed-for #603

Merged
merged 2 commits into from
Nov 16, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Contributed to DMN TCK by StrayAlien -->
<testCases xmlns="http://www.omg.org/spec/DMN/20160719/testcase"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<modelName>1152-boxed-for.dmn</modelName>

<testCase id="001">
<description>Will map 'in' values based on 'return' expression</description>
<resultNode name="decision001" type="decision">
<expected>
<list>
<item>
<value xsi:type="xsd:decimal">2</value>
</item>
<item>
<value xsi:type="xsd:decimal">4</value>
</item>
<item>
<value xsi:type="xsd:decimal">6</value>
</item>
<item>
<value xsi:type="xsd:decimal">8</value>
</item>
<item>
<value xsi:type="xsd:decimal">10</value>
</item>
</list>
</expected>
</resultNode>
</testCase>

<testCase id="002">
<description>Will return an empty list when 'in' is empty</description>
<resultNode name="decision002" type="decision">
<expected>
<list>
</list>
</expected>
</resultNode>
</testCase>

<!-- commented out pending RTF. https://github.com/dmn-tck/tck/pull/602#issuecomment-1770863632 -->
<!--
<testCase id="003">
<description>Will return null when 'in' expression is not a list</description>
<resultNode name="decision003" type="decision" errorResult="true">
<expected>
<value xsi:nil="true"/>
</expected>
</resultNode>
</testCase>
-->

<!-- commented out pending RTF. https://github.com/dmn-tck/tck/pull/602#issuecomment-1770863632 -->
<!--
<testCase id="004">
<description>Will not coerce single value 'in' expression to list - and return null</description>
<resultNode name="decision004" type="decision" errorResult="true">
<expected>
<value xsi:nil="true"/>
</expected>
</resultNode>
</testCase>
-->

</testCases>
51 changes: 51 additions & 0 deletions TestCases/compliance-level-3/1152-boxed-for/1152-boxed-for.dmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions namespace="http://www.montera.com.au/spec/DMN/1152-boxed-for"
name="1152-boxed-for"
id="_i9fboPUUEeesLuP4RHs4vA"
xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<description>Boxed For Expression</description>

<decision name="decision001" id="_decision001">
<variable name="decision001"/>
<for iteratorVariable="element">
<in><literalExpression><text>[1,2,3,4,5]</text></literalExpression></in>
<return><literalExpression><text>element * 2</text></literalExpression></return>
</for>
</decision>

<decision name="decision002" id="_decision002">
<variable name="decision002"/>
<for iteratorVariable="element">
<in><literalExpression><text>[]</text></literalExpression></in>
<return><literalExpression><text>element * 2</text></literalExpression></return>
</for>
</decision>

<!-- commented out pending RTF. https://github.com/dmn-tck/tck/pull/602#issuecomment-1770863632 -->
<!--
<decision name="decision003" id="_decision003">
<variable name="decision003"/>
<for iteratorVariable="element">
<in><literalExpression><text>"not a list"</text></literalExpression></in>
<return><literalExpression><text>element</text></literalExpression></return>
</for>
</decision>
-->

<!-- commented out pending RTF. https://github.com/dmn-tck/tck/pull/602#issuecomment-1770863632 -->
<!--
<decision name="decision004" id="_decision004">
<variable name="decision004"/>
<for iteratorVariable="element">
<in><literalExpression><text>1</text></literalExpression></in>
<return><literalExpression><text>element * 2</text></literalExpression></return>
</for>
</decision>
-->

</definitions>

Loading