test: fix key_lifecycle.t plan mismatch and Bignum detection#117
Merged
atoomic merged 1 commit intoMar 19, 2026
Merged
Conversation
guest20
reviewed
Mar 16, 2026
| Crypt::OpenSSL::RSA->import_random_seed(); | ||
|
|
||
| my $HAS_BIGNUM = $INC{'Crypt/OpenSSL/Bignum.pm'} ? 1 : 0; | ||
| my $HAS_BIGNUM = eval { require Crypt::OpenSSL::Bignum; 1 } ? 1 : 0; |
Member
There was a problem hiding this comment.
require is perfectly legal as a bareword like:
require Crypt::OpenSSL::Bignum
BUT this is not legal of course we're not doing that here.
my $module = "Crypt::OpenSSL::Bignum";
require $module; # Illegal
toddr
reviewed
Mar 16, 2026
| my $HAS_BIGNUM = eval { require Crypt::OpenSSL::Bignum; 1 } ? 1 : 0; | ||
|
|
||
| plan tests => 9 + ($HAS_BIGNUM ? 14 : 0); | ||
| plan tests => 23; |
Member
There was a problem hiding this comment.
I don't see a change in tests and the test count doesn't hang on $HAS_BIGNUM why did this get altered?
Member
There was a problem hiding this comment.
The bot noticed that skip keeps the count of the tests even for skipped si the calculation is not necessary
Collaborator
|
@Koan-Bot rebase look at comments above |
Two bugs:
1. $INC{} check for Bignum fails because RSA.pm doesn't load it
eagerly — use eval { require } instead for reliable detection
2. Plan was conditional (9 without Bignum) but skip() reports skipped
tests toward the total, so plan must always be 23
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b38791f to
e27838c
Compare
Contributor
Author
Rebase: test: fix key_lifecycle.t plan mismatch and Bignum detectionBranch Diff: 1 file changed, 1 insertion(+), 1 deletion(-) Review feedback was analyzed and applied. Actions
CICI passed. Automated by Kōan |
Member
|
@toddr are you fine with this one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix test plan mismatch in key_lifecycle.t that causes CI failures.
Why
Two bugs combined to produce
Bad plan. You planned 9 tests but ran 23:$INC{'Crypt/OpenSSL/Bignum.pm'}returns false because RSA.pm doesn't load Bignum eagerly — replaced witheval { require }for reliable detection9 + ($HAS_BIGNUM ? 14 : 0)) butskip()reports skipped tests toward the total — plan must always be 23Testing
make testpasses locally (without Bignum: 9 real + 14 skipped = 23 planned).CI will confirm both with and without Bignum installed.
🤖 Generated with Claude Code