0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

test: use regex for OpenSSL function name

This commit modifies test-crypt-scrypt.js to use a regular expression
for the function name in the error message, similar to what is done for
the error code.

The motivation for this change comes from a case where we (Red Hat)
patch OpenSSL and the memory limit checking is done in a different
function, meaning that the function name from which this error
originates differs from that when linking to the OpenSSL version shipped
with Node.js.

PR-URL: https://github.com/nodejs/node/pull/28289
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Daniel Bevenius 2019-06-19 05:18:02 +02:00
parent c6f968de71
commit c1ee66804c

View File

@ -169,7 +169,8 @@ for (const options of bad) {
for (const options of toobig) {
const expected = {
message: /error:[^:]+:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded/,
message: new RegExp('error:[^:]+:digital envelope routines:' +
'(?:EVP_PBE_scrypt|scrypt_alg):memory limit exceeded'),
type: Error,
};
common.expectsError(() => crypto.scrypt('pass', 'salt', 1, options, () => {}),