test: add edge case tests for Digest::base and fix b64digest arg forwarding#22
Draft
test: add edge case tests for Digest::base and fix b64digest arg forwarding#22
Conversation
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>
13 tasks
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 comprehensive edge case test coverage for
Digest::baseand fixesb64digestto forward@_todigest()consistently withhexdigest.Why
hexdigestforwards arguments todigest(), butb64digestsilently dropped them. This inconsistency means subclasses that accept optional arguments todigest()get different behavior depending on the output format.How
b64digestnow passes@_throughbase64_padded_digesttodigest(1-char change)t/base-edge.twith 15 tests covering: reset(), method chaining, auto-reset after digest, clone independence, addfile error handling, b64digest arg forwarding, padding behaviorTesting
All 15 new tests pass locally. Existing tests unaffected.
🤖 Generated with Claude Code