yesamer commented on code in PR #6040:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6040#discussion_r1700062055


##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/FEEL12ExtendedForLoopTest.java:
##########
@@ -45,10 +45,15 @@ protected void instanceTest(String expression, Object 
result, FEELEvent.Severity
     }
 
     private static Collection<Object[]> data() {
+        List<Integer> nullObject = new ArrayList<>();
+        nullObject.add(null);
+        nullObject.add(null);
+        nullObject.add(null);
         final Object[][] cases = new Object[][] {
           //normal:
           {"for x in [1, 2, 3] return x+1", Stream.of(1, 2, 3 ).map(x -> 
BigDecimal.valueOf(x + 1 ) ).collect(Collectors.toList() ), null},
-          {"for x in @\"2021-01-01\"..@\"2021-01-03\" return x+1", 
Stream.of("2021-01-02", "2021-01-03", "2021-01-04" 
).map(LocalDate::parse).collect(Collectors.toList() ), null},
+                {"for x in @\"2021-01-01\"..@\"2021-01-03\" return x + 
@\"P1D\"", Stream.of("2021-01-02", "2021-01-03", "2021-01-04" 
).map(LocalDate::parse).collect(Collectors.toList() ), null},
+                {"for x in @\"2021-01-01\"..@\"2021-01-03\" return x+1", 
nullObject, FEELEvent.Severity.ERROR},

Review Comment:
   @gitgabrio Is it expected this test case returns a List of null? WDYT?



##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/FEELDateTimeDurationTest.java:
##########
@@ -51,6 +51,8 @@ protected void instanceTest(String expression, Object result, 
FEELEvent.Severity
     private static Collection<Object[]> data() {
         final Object[][] cases = new Object[][] {
                 // date/time/duration function invocations
+                { "@\"2021-01-01\" + 10", null , FEELEvent.Severity.ERROR},
+                { "@\"2021-01-01T10:10:10\" + 10", null , 
FEELEvent.Severity.ERROR},

Review Comment:
   @bncriju Can you please add here those additional test cases:
   - number + Date
   - number + DateTime
   - number - Date
   - number - DateTime
   - Date - number 
   - DateTime - number
   
   They should all return null with an error.
   
   Just for the sake of completeness :)
   Thank you
   



-- 
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]

Reply via email to