Skip to content

test(entropy): cover variant constructor, zero-len, length-distinct caches, clone#699

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/cov-entropy-edges
May 16, 2026
Merged

test(entropy): cover variant constructor, zero-len, length-distinct caches, clone#699
EffortlessSteven merged 1 commit into
mainfrom
claude/cov-entropy-edges

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Closes coverage gaps in uselesskey-entropy identified by walking the public surface against the inline tests. No production code changes.

Gaps closed

Area What was missing New test
entropy_with_variant end-to-end Constructor was tested only through accessors (label()/variant()); never verified the variant actually flowed into derivation entropy_with_variant_constructor_derives_from_custom_variant
fill_bytes_with_variant (explicit variant) fill_bytes (default variant) covered, but the explicit-variant fill path was not fill_bytes_with_variant_matches_allocating_path
bytes(0) and fill_bytes on &mut [] Boundary case not covered explicitly (proptest may or may not include zero) zero_length_request_returns_empty_buffer
bytes(N) vs bytes(M) cache identity The cache spec includes len.to_le_bytes(), so different lengths must hit distinct cache entries — never validated distinct_lengths_produce_distinct_caches
Clone on EntropyFixture Derived but never exercised cloned_fixture_handles_share_cache_identity
DOMAIN_ENTROPY_FIXTURE constant Value never pinned by a test; a rename would silently shift downstream fixtures domain_constant_is_stable_for_the_lifetime_of_v1

7 new tests, all using TestResult + require_ok to keep the no-panic-family check at zero new debt.

Test plan

  • cargo test -p uselesskey-entropy --lib — 14/14 pass (7 new + 7 existing)
  • cargo clippy -p uselesskey-entropy --tests --all-features -- -D warnings
  • cargo xtask check-no-panic-family — only the pre-existing xtask/src/user_path_smoke.rs:126 debt remains
  • cargo fmt --check -p uselesskey-entropy

https://claude.ai/code/session_01R9SN1o9XoVTaVxj9w4VMzD


Generated by Claude Code

…aches, clone

Adds 7 inline tests to `uselesskey-entropy` that close coverage gaps:

- `entropy_with_variant` constructor wires the variant into derivation
  (not just into accessors)
- `fill_bytes_with_variant` matches the allocating `bytes_with_variant`
  path and differs from the default-variant fill
- Zero-length request returns an empty buffer and `fill_bytes` on a
  zero-length destination is a no-op
- Distinct lengths produce independent cache entries (the spec includes
  `len.to_le_bytes()`, so `bytes(16)` is not a prefix of `bytes(32)`)
- Cloning an `EntropyFixture` shares cache identity (label/variant/bytes)
- `DOMAIN_ENTROPY_FIXTURE` constant pinned to its v1 value so a rename
  trips CI rather than silently drifting downstream fixtures

No production code changes. All tests use `TestResult` + `require_ok` so
no new no-panic-family debt.

https://claude.ai/code/session_01R9SN1o9XoVTaVxj9w4VMzD
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 21 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63dc5883-206c-46d7-84b5-ae776762ae5e

📥 Commits

Reviewing files that changed from the base of the PR and between fad488d and b6d9bdc.

📒 Files selected for processing (1)
  • crates/uselesskey-entropy/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/cov-entropy-edges

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven marked this pull request as ready for review May 16, 2026 02:40
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven merged commit 9c1b458 into main May 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants