Skip to content

feat: support block-scope //mutest:skip for if/for/switch/select#27

Merged
fchimpan merged 2 commits into
mainfrom
feat/block-scope-skip
Mar 27, 2026
Merged

feat: support block-scope //mutest:skip for if/for/switch/select#27
fchimpan merged 2 commits into
mainfrom
feat/block-scope-skip

Conversation

@fchimpan

Copy link
Copy Markdown
Owner

Summary

  • When //mutest:skip is placed on a block statement (if, for, switch, select), all mutations within the entire block are now skipped, including nested statements
  • Previously only the annotated line itself was skipped, requiring separate skip comments on each inner line
  • Simplify existing //mutest:skip usage in main.go by removing redundant inner skip comment

Test plan

  • go test ./... -race passes
  • go vet ./... passes
  • New tests: TestDiscoverAll_SkipDirective_Block, TestDiscoverAll_SkipDirective_ForBlock, TestDiscoverAll_SkipDirective_IfElseBlock
  • Existing skip directive tests still pass

When //mutest:skip is placed on a block statement (if, for, switch,
select), all mutations within the entire block are now skipped,
including nested statements. Previously only the annotated line itself
was skipped, requiring separate skip comments on each inner line.
@fchimpan fchimpan merged commit 9e4ea88 into main Mar 27, 2026
2 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.

1 participant