From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 10/21] test_that_key_in_arry_has_value: Check if a key in an array exists Date: Mon, 20 May 2024 11:06:00 +0200 Message-ID: <20240520090611.10406-11-jonatan.schlag@ipfire.org> In-Reply-To: <20240520090611.10406-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0321593554234569829==" List-Id: --===============0321593554234569829== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Jonatan Schlag --- tests/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/lib.sh b/tests/lib.sh index ad7c12cb0..81bc1439c 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -38,7 +38,8 @@ test_that_key_in_arry_has_value() { return 1 fi =20 - if [[ ! -v "${array[${key}]}" ]]; then + + if [[ "${array["${key}"]+_}" =3D=3D "" ]]; then log_test_failed "The array does not contain the key '${key}', valid keys a= re: ${!array[*]}" return 1 fi --=20 2.39.2 --===============0321593554234569829==--