Skip to content

test: kill surviving mutants in core microcrates#167

Merged
EffortlessSteven merged 1 commit into
mainfrom
wave-134/impl
Mar 5, 2026
Merged

test: kill surviving mutants in core microcrates#167
EffortlessSteven merged 1 commit into
mainfrom
wave-134/impl

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Add targeted tests to kill surviving mutants in core microcrates.

Changes:

  • uselesskey-core-base62: output diversity and fallback modulo tests
  • uselesskey-core-negative-pem: structural assertions and exact arithmetic tests
  • uselesskey-core-negative-der: boundary and arithmetic tests

@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.

@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 Mar 2, 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 9 minutes and 7 seconds before requesting another review.

⌛ 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.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c1a339e5-ae62-4828-bf0a-3bba8d387576

📥 Commits

Reviewing files that changed from the base of the PR and between 9b2514e and ee002d0.

📒 Files selected for processing (3)
  • crates/uselesskey-core-base62/src/lib.rs
  • crates/uselesskey-core-negative-der/src/lib.rs
  • crates/uselesskey-core-negative-pem/src/lib.rs

Walkthrough

These changes add comprehensive unit tests across three crates to validate edge-case behaviors in base62 conversion, DER corruption helpers, and PEM corruption handlers. No public API changes or functional logic modifications are introduced.

Changes

Cohort / File(s) Summary
Base62 Tests
crates/uselesskey-core-base62/src/lib.rs
Added two unit tests: output_uses_diverse_alphabet validates alphabet diversity in random_base62 output, and fallback_path_uses_modulo_not_division verifies correct modulo operation behavior in fallback path using custom AllMaxRng.
DER Corruption Tests
crates/uselesskey-core-negative-der/src/lib.rs
Added four unit tests covering truncate_der (no-op when len >= input length), flip_byte (no-op when offset >= input length), and derived_truncate_len_bytes (nonzero for large inputs, zero for zero-length inputs).
PEM Corruption Tests
crates/uselesskey-core-negative-pem/src/lib.rs
Added tests for BadBase64 (invalid base64 injection after header), ExtraBlankLine (blank line insertion at header), and derived_truncate_len (edge cases for exact arithmetic, empty input, and single character).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Tests are planted like carrots in rows,
Each edge case tested where danger grows,
Base62 hops, DER flips with care,
PEM bytes dance in the test-filled air! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test: kill surviving mutants in core microcrates' directly and clearly summarizes the main change—adding targeted tests to eliminate mutation-test survivors across core microcrates.
Description check ✅ Passed The description is related to the changeset, detailing the specific tests added to three core microcrates (base62, negative-pem, negative-der) to eliminate surviving mutants.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wave-134/impl

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 force-pushed the wave-134/impl branch 5 times, most recently from 9b2514e to e88d077 Compare March 5, 2026 14:04
Add targeted tests to eliminate mutations that survive in:

- uselesskey-core-base62: output diversity and fallback modulo tests
  catch % -> / mutations in rejection sampling and fallback paths
- uselesskey-core-negative-pem: structural assertions for inject_bad_base64_line
  and inject_blank_line catch < boundary mutations; exact arithmetic
  tests for derived_truncate_len catch return-constant and operator mutations
- uselesskey-core-negative-der: exact arithmetic tests for
  derived_truncate_len_bytes and boundary tests for truncate/flip helpers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@EffortlessSteven EffortlessSteven merged commit 5d912b0 into main Mar 5, 2026
3 of 4 checks passed
@EffortlessSteven EffortlessSteven deleted the wave-134/impl branch March 5, 2026 15:19
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.

1 participant