remove dead code and add API guard tests#83
Draft
toddr-bot wants to merge 1 commit into
Draft
Conversation
Remove unused $Net::ACME2::_POST_METHOD package variable (declared but never read or assigned anywhere in the codebase). Add t/Net-ACME2-api-guards.t covering previously untested guard conditions in the public API: - new() without key throws - http_timeout() sync mode passthrough - http_timeout() async mode rejection - update_account() without key_id throws
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
Removes an unused package variable and adds test coverage for previously untested
public API guard conditions.
Why
$_POST_METHODwas declared asourin Net::ACME2 but never read or assigned —pure dead code. The four guard conditions tested here (constructor validation,
http_timeout()sync/async behavior,update_account()key_id check) aredocumented public API behaviors that had zero test coverage.
How
our $_POST_METHOD;(line 1147) — confirmed via grep that no codereferences it anywhere.
t/Net-ACME2-api-guards.tcovers:new()without key → dieshttp_timeout()passthrough in sync mode (get, set, verify)http_timeout()rejection in async mode (mock async UA)update_account()without key_id → diesTesting
Full test suite passes (all existing tests + 4 new subtests with 6 assertions).
Quality Report
Changes: 3 files changed, 116 insertions(+), 2 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan