Skip to content

Commit

Permalink
[fixup] only run test if OpenSSL supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
tniessen committed Jan 31, 2021
1 parent 38eb549 commit 0fdea88
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions test/parallel/test-crypto-prime.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,24 @@ generatePrime(
// The behavior when specifying only add without rem should depend on the
// safe option.

generatePrime(128, {
bigint: true,
add: 5n
}, common.mustSucceed((prime) => {
assert(checkPrimeSync(prime));
assert.strictEqual(prime % 5n, 1n);
}));
if (process.versions.openssl >= '1.1.1f') {
generatePrime(128, {
bigint: true,
add: 5n
}, common.mustSucceed((prime) => {
assert(checkPrimeSync(prime));
assert.strictEqual(prime % 5n, 1n);
}));

generatePrime(128, {
bigint: true,
safe: true,
add: 5n
}, common.mustSucceed((prime) => {
assert(checkPrimeSync(prime));
assert.strictEqual(prime % 5n, 3n);
}));
generatePrime(128, {
bigint: true,
safe: true,
add: 5n
}, common.mustSucceed((prime) => {
assert(checkPrimeSync(prime));
assert.strictEqual(prime % 5n, 3n);
}));
}
}

[1, 'hello', {}, []].forEach((i) => {
Expand Down

0 comments on commit 0fdea88

Please sign in to comment.