From 0155298234ba1f54182021b40f34f773ad4e0169 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 15:55:30 +0100 Subject: [PATCH] Remove optional tests in favor of returns or throws --- tests/README.md | 7 +++---- tests/array_append.json5 | 7 +++---- tests/array_concat.json5 | 5 +++-- tests/is_nodata.json5 | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/README.md b/tests/README.md index 126a0b8d..82d6f69e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -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 diff --git a/tests/array_append.json5 b/tests/array_append.json5 index 9e72fd80..e1f3ec33 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -76,9 +76,8 @@ "returns": [ "a", "b" - "3" - ], - "optional": true + "c" + ] }, { "arguments": { @@ -94,7 +93,7 @@ "3" ], // mixing data types is optional - "optional": true + "throws": true }, { "arguments": { diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 index b391e0e8..92bece96 100644 --- a/tests/array_concat.json5 +++ b/tests/array_concat.json5 @@ -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", @@ -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) diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index 6ba64844..f41a328d 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -14,7 +14,7 @@ }, "returns": false, // Optional to avoid an error in case the no-data value is 1 - "optional": true + "throws": true }, { "arguments": {