Skip to content

Commit

Permalink
context function test
Browse files Browse the repository at this point in the history
  • Loading branch information
yesamer committed Jun 27, 2024
1 parent d186f66 commit 6fe1835
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected void instanceTest(String expression, Object result, FEELEvent.Severity

private static Collection<Object[]> data() {
final Object[][] cases = new Object[][] {
{ "string(\"Happy %.0fth birthday, Mr %s!\", 38, \"Doe\")", "Happy 38th birthday, Mr Doe!", null},
/*{ "string(\"Happy %.0fth birthday, Mr %s!\", 38, \"Doe\")", "Happy 38th birthday, Mr Doe!", null},
{ "now()", ZonedDateTime.class , null},
{ "today()", LocalDate.class, null },
{ "string join([\"a\",\"b\",\"c\"], \"_and_\")", "a_and_b_and_c", null},
Expand Down Expand Up @@ -127,9 +127,9 @@ private static Collection<Object[]> data() {
{ "context merge([{name: \"John Doe\", age: 0}, {age: 47}])", mapOf(entry("name", "John Doe"),entry("age", new BigDecimal(47))), null },
{ "context([{key: \"name\", value: \"John Doe\"},{\"key\":\"age\", \"value\":47}])", mapOf(entry("name", "John Doe"),entry("age", new BigDecimal(47))), null },
{ "context([{key: \"name\", value: \"John Doe\"},{\"key\":\"age\", \"value\":47, \"something\":\"else\"}])", mapOf(entry("name", "John Doe"),entry("age", new BigDecimal(47))), null },
{ "context([{key: \"name\", value: \"John Doe\"},{\"key\":\"age\"}])", null, FEELEvent.Severity.ERROR },
{ "context([{key: \"name\", value: \"John Doe\"},{\"key\": \"name\" \"value\": \"Doe John\"}])", null, FEELEvent.Severity.ERROR },
{ "time(10, 20, 30)", LocalTime.of(10, 20, 30), null },
{ "context([{key: \"name\", value: \"John Doe\"},{\"key\":\"age\"}])", null, FEELEvent.Severity.ERROR }, */
{ "context([{key: \"name\", value: \"John Doe\"},{key: \"name\", value: \"Doe John\"}])", null, FEELEvent.Severity.ERROR },
/*{ "time(10, 20, 30)", LocalTime.of(10, 20, 30), null },
{ "date( 2020, 2, 31 )", null, FEELEvent.Severity.ERROR},
{ "date( \"2020-02-31\" )", null, FEELEvent.Severity.ERROR},
{ "range(\"[1..10]\")", Range.class, null },
Expand All @@ -143,7 +143,7 @@ private static Collection<Object[]> data() {
{ "range(\"[1..10[\").end included", false, null },
{ "range(\"[date(\\\"2022-01-01\\\")..date(\\\"2023-01-01\\\"))\")", Range.class, null },
{ "range(\"[date(\\\"2022-01-01\\\")..date(\\\"2023-01-01\\\"))\").end included", false, null },
{ "range(\"[date(\\\"2022-01-01\\\")..date(\\\"2023-01-01\\\"))\").end.year", new BigDecimal("2023"), null },
{ "range(\"[date(\\\"2022-01-01\\\")..date(\\\"2023-01-01\\\"))\").end.year", new BigDecimal("2023"), null },*/
};
return addAdditionalParameters(cases, true);
}
Expand Down

0 comments on commit 6fe1835

Please sign in to comment.