test(entropy): cover variant constructor, zero-len, length-distinct caches, clone#699
Conversation
…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
|
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 selected for processing (1)
✨ 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
Closes coverage gaps in
uselesskey-entropyidentified by walking the public surface against the inline tests. No production code changes.Gaps closed
entropy_with_variantend-to-endlabel()/variant()); never verified the variant actually flowed into derivationentropy_with_variant_constructor_derives_from_custom_variantfill_bytes_with_variant(explicit variant)fill_bytes(default variant) covered, but the explicit-variant fill path was notfill_bytes_with_variant_matches_allocating_pathbytes(0)andfill_byteson&mut []zero_length_request_returns_empty_bufferbytes(N)vsbytes(M)cache identitylen.to_le_bytes(), so different lengths must hit distinct cache entries — never validateddistinct_lengths_produce_distinct_cachesCloneonEntropyFixturecloned_fixture_handles_share_cache_identityDOMAIN_ENTROPY_FIXTUREconstantdomain_constant_is_stable_for_the_lifetime_of_v17 new tests, all using
TestResult+require_okto 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 warningscargo xtask check-no-panic-family— only the pre-existingxtask/src/user_path_smoke.rs:126debt remainscargo fmt --check -p uselesskey-entropyhttps://claude.ai/code/session_01R9SN1o9XoVTaVxj9w4VMzD
Generated by Claude Code