test: remove loop over single element

This loop used to iterate over two elements, but since commit
215f4d04b7, it only iterates over
a single element. Therefore, move the test out of the loop body
and remove the loop itself.

Refs: https://github.com/nodejs/node/pull/50973
PR-URL: https://github.com/nodejs/node/pull/58368
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Tobias Nießen authored and Michaël Zasso committed 2025-05-31 13:23:24 +02:00
1 parent b882148999
commit d0302e7b3d
1 file changed
+8 -11
+8 -11
View File
@@ -561,17 +561,14 @@ for (const test of TEST_CASES) {
const iv = Buffer.alloc(12);
const opts = { authTagLength: 10 };
for (const cipher of [
crypto.createCipheriv(algo, key, iv, opts),
]) {
assert.throws(() => {
cipher.final();
}, hasOpenSSL3 ? {
code: 'ERR_OSSL_TAG_NOT_SET'
} : {
message: /Unsupported state/
});
}
const cipher = crypto.createCipheriv(algo, key, iv, opts);
assert.throws(() => {
cipher.final();
}, hasOpenSSL3 ? {
code: 'ERR_OSSL_TAG_NOT_SET'
} : {
message: /Unsupported state/
});
}
{