Skip to content

Commit

Permalink
Remove optional tests in favor of returns or throws
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Oct 30, 2023
1 parent 83ddc2c commit 0155298
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
7 changes: 3 additions & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,15 @@ properties:
type: object
additionalProperties:
description: An argument, can be of any type
optional:
description: Marks optional test so a failure produces only a warning.
type: boolean
default: false
returns:
description: The return value, can be of any type
delta:
description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy.
type: number
throws:
description: >-
Specifies whether the execution is meant to throw an exception.
If used in combination with a return value, it makes the test effectively optional.
oneOf:
- description: Specify an exception name from the process specification
type: string
Expand Down
7 changes: 3 additions & 4 deletions tests/array_append.json5
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@
"returns": [
"a",
"b"
"3"
],
"optional": true
"c"
]
},
{
"arguments": {
Expand All @@ -94,7 +93,7 @@
"3"
],
// mixing data types is optional
"optional": true
"throws": true
},
{
"arguments": {
Expand Down
5 changes: 3 additions & 2 deletions tests/array_concat.json5
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
]
},
{
// Concatenates two arrays containing different data type, may not always be supported.
// Concatenates two arrays containing different data type
"arguments": {
"array1": [
"a",
Expand All @@ -59,7 +59,8 @@
1,
2
],
"optional": true
// May not always be supported
"throws": true
},
{
// Check that a normal array and a labeled array lead to a normal array (labels get dropped)
Expand Down
2 changes: 1 addition & 1 deletion tests/is_nodata.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"returns": false,
// Optional to avoid an error in case the no-data value is 1
"optional": true
"throws": true
},
{
"arguments": {
Expand Down

0 comments on commit 0155298

Please sign in to comment.