tarilabs commented on code in PR #5645:
URL:
https://github.com/apache/incubator-kie-drools/pull/5645#discussion_r1450696560
##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/FEELFunctionsTest.java:
##########
@@ -237,6 +237,12 @@ public static Collection<Object[]> data() {
{ "{a: -2, r: -sum( 1, -abs(a), 3 )}.r", BigDecimal.valueOf(
-2 ) , null},
{ "if list contains ([2.2, 3.0, 4.0], 3) then \"OK\" else
\"NOT_OK\"", "OK" , null},
{ "if list contains ([2.2, 3, 4], 3.000) then \"OK\" else
\"NOT_OK\"", "OK" , null},
+ {"list replace ( null, 3, 6)", null ,
FEELEvent.Severity.ERROR},
+ {"list replace ( [2, 4, 7, 8], null, 6)", null ,
FEELEvent.Severity.ERROR},
+ {"list replace ( [2, 4, 7, 8], 3, 6)",
Arrays.asList(BigDecimal.valueOf(2), BigDecimal.valueOf(4),
BigDecimal.valueOf(6), BigDecimal.valueOf(8)), null},
+ {"list replace ( [2, 4, 7, 8], function(item, newItem) item +
newItem, 6)", null , FEELEvent.Severity.ERROR},
+ {"list replace ( [\"El-1\", \"El-2\", \"El-3\", \"El-4\"],
function(item, newItem) item = \"El-2\", null)", Arrays.asList("El-1", null,
"El-3", "El-4"), null},
+ {"list replace ( [2, 4, 7, 8], function(item, newItem) item <
newItem, 5)", Arrays.asList(BigDecimal.valueOf(5), BigDecimal.valueOf(5),
BigDecimal.valueOf(7), BigDecimal.valueOf(8)), null}
Review Comment:
yep, I'm just unsure why they specified the 2nd argument predicate to be a
function in _two_ arguments?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]