Skip to content

refactor(core): colocate tests into _tests.rs files#8

Merged
tupe12334 merged 1 commit into
mainfrom
refactor/colocate-core-tests
Jun 2, 2026
Merged

refactor(core): colocate tests into _tests.rs files#8
tupe12334 merged 1 commit into
mainfrom
refactor/colocate-core-tests

Conversation

@tupe12334
Copy link
Copy Markdown
Owner

Summary

  • Extract all #[cfg(test)] mod tests { ... } blocks from 6 core source files into sibling *_tests.rs files
  • Each source file declares its test module via #[cfg(test)] #[path = "..."] mod tests;
  • Logic files are now test-free; test files are colocated next to the logic they cover

Files split: detect, events, tools, response, parse, lib

Test plan

  • cargo test -p polyhook-core — all 138 tests pass
  • Coverage hook passes (100% line coverage maintained)

🤖 Generated with Claude Code

Move inline #[cfg(test)] mod tests blocks from each source file into
sibling *_tests.rs files declared via #[cfg(test)] #[path = "..."] mod tests;.
Affects detect, events, tools, response, parse, and lib. All 138 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tupe12334 tupe12334 merged commit 898b6da into main Jun 2, 2026
7 checks passed
@tupe12334 tupe12334 deleted the refactor/colocate-core-tests branch June 2, 2026 20:06
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