From 6b074ce7e83d79c881bb0438b761a859df99a29e Mon Sep 17 00:00:00 2001 From: StrayAlien Date: Thu, 19 Oct 2023 23:16:57 +1100 Subject: [PATCH] DMN 1.4 - 1147-feel-context-merge-function (#598) * 1147-feel-context-merge-function * replace xsd:double with xsd:decimal --- ...47-feel-context-merge-function-test-01.xml | 159 ++++++++++++++++++ .../1147-feel-context-merge-function.dmn | 111 ++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function-test-01.xml create mode 100644 TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function.dmn diff --git a/TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function-test-01.xml b/TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function-test-01.xml new file mode 100644 index 000000000..888b936ba --- /dev/null +++ b/TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function-test-01.xml @@ -0,0 +1,159 @@ + + + + 1147-feel-context-merge-function.dmn + + + + + + + + Will merge a context + + + + 1 + + + + + + + Will merge empty context + + + true + + + + + + Will merge multiple contexts + + + + 1 + + + 2 + + + + + + + Will overwrite existing context entry + + + + 2 + + + + + + + Will overwrite (not merge) nested contexts + + + + + 2 + + + + + + + + Null contexts param gives null + + + + + + + + + Too few params gives null + + + + + + + + + Too many params gives null + + + + + + + + + named params + + + + 1 + + + + + + + Incorrect named param gives null + + + + + + + + + Incorrect 'contexts' type gives null + + + + + + + + + Non-context entry in 'contexts' gives null + + + + + + + + + Will coerce single context to list + + + + 1 + + + + + + + Will coerce single name param entry to list + + + + 1 + + + + + + diff --git a/TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function.dmn b/TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function.dmn new file mode 100644 index 000000000..5fd7be9c0 --- /dev/null +++ b/TestCases/compliance-level-3/1147-feel-context-merge-function/1147-feel-context-merge-function.dmn @@ -0,0 +1,111 @@ + + + FEEL built-in function 'context put(context, key, value)' in category context functions + + + + + context merge([{"a": 1}]) + + + + + + + context merge([{}]) = {} + + + + + + + context merge([{"a": 1}, {"b": 2}]) + + + + + + + context merge([{"a": 1}, {"a": 2}]) + + + + + + + context merge([{"a": {"aa": 1}}, {"a": {"bb": 2}}]) + + + + + + + context merge(null) + + + + + + + context merge() + + + + + + + context merge([],"foo") + + + + + + + context merge(contexts: [{"a": 1}]) + + + + + + + context merge(context: [{"a": 1}]) + + + + + + + context merge([1,2,3]) + + + + + + + context merge([{"a": 1},2,{"b": 2}]) + + + + + + + context merge({"a": 1}) + + + + + + + context merge(contexts: {"a": 1}) + + + + +