test: expand Digest::base edge case coverage + fix b64digest @_ forwarding#9
Draft
toddr-bot wants to merge 22 commits into
Draft
test: expand Digest::base edge case coverage + fix b64digest @_ forwarding#9toddr-bot wants to merge 22 commits into
toddr-bot wants to merge 22 commits into
Conversation
Drop use vars
- meta-spec 2 resources format - dependencies are static, set dynamic_config 0 - EUMM will set configure_requires on itself - Test::More only used in tests - boilerplate to clean out unsupported keys if installed with old EUMM
Makefile.PL - use meta-spec 2, fix prereqs, compatibility with old EUMM
base.t, file.t: unlink temporary files created during testing
Ignore common temp files in repo.
hexdigest() forwards extra arguments to digest(), but b64digest() silently dropped them. This makes the base class methods consistent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 new tests covering: - reset() state clearing via instance-method new() - Method chaining (add returns $self) - Chained add equivalence with multi-arg add - Auto-reset after digest/hexdigest/b64digest - Fresh accumulation after digest reset - clone() independence from original - base64_padded_digest encoding correctness - b64digest padding stripping - b64digest @_ forwarding (validates the base.pm fix) - addfile() complete file reading - addfile() error handling (croak on read failure) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Adds 15 edge case tests for
Digest::baseand fixes a minor inconsistency inb64digest().Why
The base class has only 13 tests, none covering
reset(),clone()independence, auto-reset behavior after digest operations, oraddfile()error handling. These gaps mean regressions in the base class contract could go undetected.The
b64digestfix:hexdigest()andbase64_padded_digest()both forward@_todigest(), butb64digest()silently dropped extra arguments. A one-line fix for consistency.How
b64digestto forward@_throughbase64_padded_digest(one line)t/base-edge.twith mock digest classes that properly implement the instance-methodnew()contract (as documented in the Digest POD)Tests cover:
reset(), method chaining, chained vs multi-argadd()equivalence, auto-reset afterdigest/hexdigest/b64digest,clone()independence, base64 padding correctness,@_forwarding,addfile()content and error paths.Testing
All 38 tests pass (23 existing + 15 new). Tested locally.
🤖 Generated with Claude Code