From e2b03b4399f82175c01fc307212d40044118f091 Mon Sep 17 00:00:00 2001 From: StrayAlien Date: Sat, 24 Jun 2023 11:24:11 +1000 Subject: [PATCH] 1143-feel-round-half-up-function --- ...43-feel-round-half-up-function-test-01.xml | 197 ++++++++++++++++++ .../1143-feel-round-half-up-function.dmn | 153 ++++++++++++++ 2 files changed, 350 insertions(+) create mode 100644 TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function-test-01.xml create mode 100644 TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function.dmn diff --git a/TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function-test-01.xml b/TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function-test-01.xml new file mode 100644 index 000000000..b3265b5d4 --- /dev/null +++ b/TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function-test-01.xml @@ -0,0 +1,197 @@ + + + + 1143-feel-round-half-up-function.dmn + + + + + + + + Will round to integer + + + 6 + + + + + + Will round to negative to integer + + + -6 + + + + + + Will round positive to scale + + + 1.12 + + + + + + Will round negative to scale + + + -1.13 + + + + + + No params gives null + + + + + + + + + Missing scale param gives null + + + + + + + + + null number gives null + + + + + + + + + null scale gives null + + + + + + + + + Too many params gives null + + + + + + + + + named params + + + 6 + + + + + + Missing 'n' named param gives null + + + + + + + + + Missing 'scale' named param gives null + + + + + + + + + Incorrect named param gives null + + + + + + + + + Incorrect 'n' type gives null + + + + + + + + + Incorrect 'scale' type gives null + + + + + + + + + Non integer scale param gives null + + + + + + + + + + + less than min scale gives null + + + + + + + + + Max scale is 6176 + + + 5.5 + + + + + + Greater than max scale gives null + + + + + + + + diff --git a/TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function.dmn b/TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function.dmn new file mode 100644 index 000000000..5061ba60a --- /dev/null +++ b/TestCases/compliance-level-3/1143-feel-round-half-up-function/1143-feel-round-half-up-function.dmn @@ -0,0 +1,153 @@ + + + FEEL built-in function 'round half up(n,scale)' in category number functions + + + + + round half up(5.5, 0) + + + + + + + round half up(-5.5, 0) + + + + + + + round half up(1.121, 2) + + + + + + + round half up(-1.126, 2) + + + + + + + round half up() + + + + + + + round half up(1234) + + + + + + + round half up(null,0) + + + + + + + round half up(1234,null) + + + + + + + round half up(1234.12,1,2) + + + + + + + round half up(n:5.5,scale:0) + + + + + + + round half up(scale:0) + + + + + + + round half up(n:5.5) + + + + + + + round half up(n:5.5,scale:0,foo:123) + + + + + + + round half up("123", 0) + + + + + + + round half up(5.5, "0") + + + + + + + round half up(5.5, 1.1) + + + + + + + round half up(5.5, -6111) + + + + + + + round half up(5.5, (-6111 - 1)) + + + + + + + round half up(5.5, 6176) + + + + + + + round half up(5.5, (6176 + 1)) + + + + +