Skip to content

Commit

Permalink
Truncate decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
StrayAlien committed Oct 5, 2024
1 parent 747b872 commit 9e8a495
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,27 @@
</testCase>

<testCase id="011">
<description>position must be an integer number</description>
<resultNode name="decision011" type="decision" errorResult="true">
<description>position will be truncated to integer</description>
<resultNode name="decision011" type="decision">
<expected>
<value xsi:nil="true"/>
<list>
<item><value xsi:type="xsd:decimal">1</value></item>
<item><value xsi:type="xsd:decimal">4</value></item>
<item><value xsi:type="xsd:decimal">3</value></item>
</list>
</expected>
</resultNode>
</testCase>

<testCase id="011_a">
<description>negative position will be truncated to integer</description>
<resultNode name="decision011_a" type="decision">
<expected>
<list>
<item><value xsi:type="xsd:decimal">1</value></item>
<item><value xsi:type="xsd:decimal">2</value></item>
<item><value xsi:type="xsd:decimal">4</value></item>
</list>
</expected>
</resultNode>
</testCase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,21 @@
</decision>

<decision name="decision011" id="_decision011">
<!-- position must be an integer number-->
<!-- decimal position is truncated to integer number -->
<variable name="decision011"/>
<literalExpression>
<text>list replace([1,2,3], 2.5, 4)</text>
</literalExpression>
</decision>

<decision name="decision011_a" id="_decision011_a">
<!-- negative decimal position is truncated to integer number -->
<variable name="decision011_a"/>
<literalExpression>
<text>list replace([1,2,3], -1.5, 4)</text>
</literalExpression>
</decision>

<decision name="decision012" id="_decision012">
<!-- named arguments 'position' -->
<variable name="decision012"/>
Expand Down

0 comments on commit 9e8a495

Please sign in to comment.