DRY refactor plus pinned-output regression tests and CI#1
Merged
Conversation
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.
Summary
zzcloneinto helper subs:transfer_cmd()(thesend | mbuffer | receivepipeline existed 4×),snap_name()(5 scattered snapshot-name regexes in 3 spellings),read_lines()(4 hand-rolled pipe-open loops),list_snapshots()andget_guid(). The full-send branch now reuses the already-computed$dest_filesetinstead of re-deriving the destination by string surgery (this also anchors the src-root substitution, fixing a latent quirk).t/regression.t: runszzcloneagainst a canned fake zfs/ssh/sudo world (t/shims) across 14 option combinations and compares stdout, stderr and exit code with pinned expected output (t/expected). The fake dataset tree covers incremental, full-send, up-to-date, no-snapshot, resume-token and guid-mismatch paths, in local, remote-source and remote-destination flavours.UPDATE_EXPECTED=1 prove t/regenerates the expected files after an intentional output change.perl -candprove t/on pushes to main and on PRs.-R/--rollback,-c/--chainand-v/--verboseoptions and add a Testing section.Verification
The generated output is byte-identical before and after the refactor: the pre-refactor script passes the exact same pinned test suite (all 28 tests) as the refactored one. No dependencies beyond core Perl;
proveships with it.🤖 Generated with Claude Code