-
Notifications
You must be signed in to change notification settings - Fork 25
Arithmetic expression functions #1651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
olavsorl
wants to merge
55
commits into
main
Choose a base branch
from
feature/expressions-with-list-and-object-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
4fa6d7f
Added plus and minus functions.
olavsorl a58fd83
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl bc237c8
Added multiply and devide
olavsorl 65fd994
Added average and more unit tests for function
olavsorl 4882838
Renamed devide to divide
olavsorl 4f04237
Double fix
olavsorl 45396f2
Fixed unit tests
olavsorl e2ee639
Implemented CodeRabbits suggested changes
olavsorl fe071e5
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl 3528b68
Changed to decimal return type
olavsorl 1cd8211
Implementes suggested changes and added unit tests
olavsorl 364e4b8
improved unit test names and added min value tests
olavsorl 2a01a10
Changed from accepting multiple arguments to just accept two. Removed…
olavsorl 8b89eae
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl 5d427f5
Fixed unit tests and consistancy in functions
olavsorl fdcb872
Merge remote-tracking branch 'origin/feature/expressions-with-list-an…
olavsorl efd3168
Fixed exception message
olavsorl a90381c
Fixed test name
olavsorl 46f6067
Implemented suggested changes
olavsorl 1c226fb
Made shared test json file names more consistant
olavsorl f78d423
Added same-types-negative-positive-decimal tests for consistency with…
olavsorl 9d9d715
Implemented suggested changes by code rabbit
olavsorl 0c11ff4
Implemented suggested changes from code rabbit
olavsorl 1debfe3
Changed to single json file for each arithmetic operation.
olavsorl 362899e
Reverted change to ExpressionValue
olavsorl 200b432
Fixes
olavsorl 5258676
Improved support for unit tests nested in testCases in shared json te…
olavsorl e63e093
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl 597fcaf
Reverted change making expression nullable in ExpressionTestCaseRoot
olavsorl 1255046
Merge remote-tracking branch 'origin/feature/expressions-with-list-an…
olavsorl eb1220e
Added tests for large numbers formatted as string
olavsorl 374ffaa
Implemented suggested changes by code rabbit
olavsorl b865d6b
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl 299843b
Fixed unit test
olavsorl 3020c24
Merge remote-tracking branch 'origin/feature/expressions-with-list-an…
olavsorl 9d08787
Cleanup
olavsorl 79189e2
Implemented suggested changes by code rabbit
olavsorl 30a9c03
Implemented suggested changes by code rabbit
olavsorl ae83fb6
Implemented suggested changes
olavsorl 3bc8d30
Made some changes to the max and min limits
olavsorl a191f76
Implemented suggested changes by code rabbit
olavsorl 51c3ed4
Reverted requested change by code rabbit
olavsorl aee514a
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl 5fbae42
Change to now converting string to double before converting to decima…
olavsorl 90db3c3
Merge remote-tracking branch 'origin/feature/expressions-with-list-an…
olavsorl 0ac8517
Added unit tests also for other functions calling PrepareNumericArgs
olavsorl a6a869b
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl ffcf72e
Fixed tests for greaterThan og greaterThanEq
olavsorl cd81b26
Merge remote-tracking branch 'origin/feature/expressions-with-list-an…
olavsorl 776e361
Implemented suggested change from code rabbit
olavsorl 150181d
Implemented suggested code rabbit changes
olavsorl c6fed3e
Implemented suggested changes by Code Rabbit
olavsorl 5690e42
Implemented suggested changes
olavsorl a225e5f
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl 760aef0
Merge branch 'main' into feature/expressions-with-list-and-object-sup…
olavsorl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ore.Tests/LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-by-zero.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when trying to divide by zero", | ||
| "expression": ["divide", 15, 0], | ||
| "expectsFailure": "At least one of the arguments after the first is 0, cannot divide by 0" | ||
| } |
5 changes: 5 additions & 0 deletions
5
...re.Tests/LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-decimals.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should divide the first argument with the second", | ||
| "expression": ["divide", 0.1, 0.2], | ||
| "expects": 0.5 | ||
| } |
5 changes: 5 additions & 0 deletions
5
...LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-multiple-decimals.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when more then two arguments is present", | ||
| "expression": ["divide", 0.1, 0.2, 15, 1.50], | ||
| "expectsFailure": "Invalid number of args for compare" | ||
| } |
5 changes: 5 additions & 0 deletions
5
...s/LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-negative-values.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should divide the first argument with the second", | ||
| "expression": ["divide", -0.1, -0.2], | ||
| "expects": 0.5 | ||
| } |
5 changes: 5 additions & 0 deletions
5
...Tests/LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-null-values.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when both of the arguments are null", | ||
| "expression": ["divide", null, null], | ||
| "expectsFailure": "At least one of the arguments is not a number" | ||
| } |
5 changes: 5 additions & 0 deletions
5
...ests/LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-one-argument.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when less than two arguments are provided", | ||
| "expression": ["divide", 2.1], | ||
| "expectsFailure": "At least two arguments must be provided" | ||
| } |
5 changes: 5 additions & 0 deletions
5
...ts/LayoutExpressions/CommonTests/shared-tests/functions/divide/divide-one-null-value.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when one of the arguments is null", | ||
| "expression": ["divide", null, 2.1], | ||
| "expectsFailure": "At least one of the arguments is not a number" | ||
| } |
5 changes: 5 additions & 0 deletions
5
...ests/LayoutExpressions/CommonTests/shared-tests/functions/minus/subtracting-decimals.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should subtract the second argument from the first", | ||
| "expression": ["minus", 0.1, 0.2], | ||
| "expects": -0.1 | ||
| } |
5 changes: 5 additions & 0 deletions
5
...utExpressions/CommonTests/shared-tests/functions/minus/subtracting-multiple-decimals.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when more then two arguments is present", | ||
olavsorl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "expression": ["minus", 0.1, 0.2, 15, 1.50], | ||
| "expectsFailure": "Invalid number of args for compare" | ||
olavsorl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
5 changes: 5 additions & 0 deletions
5
...youtExpressions/CommonTests/shared-tests/functions/minus/subtracting-negative-values.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should subtract the second negative argument from the first", | ||
| "expression": ["minus", -0.1, -0.2], | ||
| "expects": 0.1 | ||
| } |
5 changes: 5 additions & 0 deletions
5
.../LayoutExpressions/CommonTests/shared-tests/functions/minus/subtracting-no-arguments.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should return 0 when no arguments are provided", | ||
| "expression": ["minus"], | ||
| "expects": 0 | ||
| } |
5 changes: 5 additions & 0 deletions
5
...s/LayoutExpressions/CommonTests/shared-tests/functions/minus/subtracting-null-values.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when both of the arguments are null", | ||
| "expression": ["minus", null, null], | ||
| "expectsFailure": "At least one of the arguments is not a number" | ||
| } |
5 changes: 5 additions & 0 deletions
5
...ayoutExpressions/CommonTests/shared-tests/functions/minus/subtracting-one-null-value.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Should throw exception when one of the arguments is null", | ||
| "expression": ["minus", null, 2.1], | ||
| "expectsFailure": "At least one of the arguments is not a number" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.