test: remove 2 redundant generate_stage_prefix tests in compile/job#1098
Draft
github-actions[bot] wants to merge 1 commit into
Draft
test: remove 2 redundant generate_stage_prefix tests in compile/job#1098github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
test_generate_stage_prefix_single_word and test_generate_stage_prefix_underscores
are strict subsets of test_generate_stage_prefix_hyphens:
- single_word ("review" → "Review"): the per-word capitalisation path is
already exercised by hyphens, which processes "my" → "My" and "agent" →
"Agent". A single-element split is indistinguishable from a multi-element
split at the map/collect level.
- underscores ("code_review_agent" → "CodeReviewAgent"): the separator
identical code path. hyphens is the stronger test — it also covers a
numeric segment ("123" → "123").
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Test Suite Reduction:
src/compile/job.rsWhat was wrong
test_generate_stage_prefix_single_word: assertsgenerate_stage_prefix("review") == "Review". The per-word capitalisation is already exercised bytest_generate_stage_prefix_hyphens, which verifies"my"→"My"and"agent"→"Agent". A single-element result fromsplit()goes through the samemap/collectpath as a multi-element result — there is no distinct code branch to protect.test_generate_stage_prefix_underscores: assertsgenerate_stage_prefix("code_review_agent") == "CodeReviewAgent". The separator predicate is!c.is_ascii_alphanumeric(), which treats'_'and'-'identically; the test exercises the same code path astest_generate_stage_prefix_hyphens. The hyphens test is strictly stronger — it also covers a numeric segment ("123"→"123"), confirming non-letter words are left as-is.Changes
test_generate_stage_prefix_single_wordtest_generate_stage_prefix_hyphenstest_generate_stage_prefix_underscorestest_generate_stage_prefix_hyphens; hyphens test is strongerVerification
cargo test 'compile::job::tests': 5 tests pass ✅cargo clippy --all-targets --all-features: no warnings ✅