test(pgp): pin DOMAIN constant, file-write paths, and PgpSpec derives#736
Conversation
`uselesskey-pgp` had a `tests/mutant_killers.rs` pinning the kind-name and stable-byte tables, but `DOMAIN_PGP_KEYPAIR` was not pinned anywhere in the workspace and the `write_private_key_armored` / `write_public_key_armored` paths were only covered transitively through the facade crate's integration test. Adds `tests/pgp_extra_coverage.rs` (tests-only) matching the existing pattern in `uselesskey-hmac`, `uselesskey-ed25519`, `uselesskey-entropy`, and `uselesskey-jwk`: - `domain_constant_is_stable` — pins `DOMAIN_PGP_KEYPAIR` value. - `pgp_spec_is_copy_and_usable_after_move` / `pgp_spec_participates_in_hash_collections` — pin `Copy`/`Hash` derives via call-site behaviour so they can't silently disappear. - `write_private_key_armored_round_trips_to_file` / `write_public_key_armored_round_trips_to_file` — read back the tempfile and assert byte-for-byte equivalence with the in-memory armored output plus expected `BEGIN PGP …` markers. - `mismatched_public_key_armored_is_distinct_pgp_armor` — pin the "valid armor / different fingerprint" contract for the negative fixture. - `pgp_keypair_clone_preserves_label_spec_and_material` — pins `Clone` semantics across the full public surface. Adds `uselesskey-test-support` as a dev-dep so the file can use `TestResult`/`ensure!`/`ensure_eq!`/`require_ok` and add zero new panic-family debt.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
uselesskey-pgpalready has atests/mutant_killers.rspinning the kind-name and stable-byte tables, but:DOMAIN_PGP_KEYPAIRwas not pinned anywhere in the workspace.write_private_key_armored/write_public_key_armoredwere only covered transitively through the facade crate's integration test — no in-crate test asserted the path/contents.PgpSpecCopy/Hashderive participation was only implied by call-site convenience, not asserted.Adds
tests/pgp_extra_coverage.rsmatching the established<crate>_extra_coverage.rspattern fromuselesskey-hmac,uselesskey-ed25519,uselesskey-entropy, anduselesskey-jwk. Tests-only — no production code changes.Pins
domain_constant_is_stable—DOMAIN_PGP_KEYPAIR == "uselesskey:pgp:keypair".pgp_spec_is_copy_and_usable_after_move/pgp_spec_participates_in_hash_collections— pinCopy/Hashvia call-site behaviour.write_private_key_armored_round_trips_to_file/write_public_key_armored_round_trips_to_file— read back the tempfile and assert byte-for-byte equivalence with the in-memory armored output plus expectedBEGIN PGP …markers.mismatched_public_key_armored_is_distinct_pgp_armor— pin the "valid armor / different fingerprint" contract for the negative fixture.pgp_keypair_clone_preserves_label_spec_and_material— pinCloneacross label, spec, fingerprint, and both armored representations.Returns
TestResult<()>and routes assertions throughuselesskey-test-support's helpers, so this PR adds zero new panic-family debt.Test plan
cargo test -p uselesskey-pgp --test pgp_extra_coverage --release— all 7 new tests passcargo clippy -p uselesskey-pgp --all-targets --all-features -- -D warningscleancargo fmt -p uselesskey-pgpcleanGenerated by Claude Code