Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- tests/lib.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/tests/lib.sh b/tests/lib.sh index 0f4de8e43..006862da6 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -38,6 +38,11 @@ test_that_key_in_arry_has_value() { return 1 fi
+ if [[ ! -v "${array[${key}]}" ]]; then + log_test_failed "The array does not contain the key '${key}', valid keys are: ${!array[*]}" + return 1 + fi + if [[ "${array[${key}]}" == "${value}" ]] ; then log_test_succeded "The array '${1}' contains the value '${value}' under the key '${key}'" return 0