Skip to content

refactor(tests): split remaining inline test mods into sibling tests.rs files#27

Merged
uqio merged 1 commit intomainfrom
refactor/split-inline-test-modules
Apr 26, 2026
Merged

refactor(tests): split remaining inline test mods into sibling tests.rs files#27
uqio merged 1 commit intomainfrom
refactor/split-inline-test-modules

Conversation

@uqio
Copy link
Copy Markdown
Collaborator

@uqio uqio commented Apr 26, 2026

Summary

Mechanical layout refactor: move 4 large inline mod tests { ... } blocks out of their parent source files into sibling tests.rs files. Pure file reorganization — zero behavior change, zero test logic change, test count unchanged at 499.

Continues the convention established by PR #21 (which split the per-arch SIMD backend tests). The remaining 4 files were the largest still carrying inline test modules.

Changes

Parent file Tests moved to Lines moved
src/frame.rs src/frame/tests.rs 1,572
src/raw/bayer16.rs src/raw/bayer16/tests.rs 474
src/raw/bayer.rs src/raw/bayer/tests.rs 393
src/raw/types.rs src/raw/types/tests.rs 251

Each parent file now ends with the standard two-line declaration (e.g. #[cfg(all(test, feature = "std"))] mod tests;), with the body verbatim in the sibling file (dedented one level, use super::*; retained). The original #[cfg] attribute style is preserved per-file (src/raw/types.rs uses bare #[cfg(test)]; the others use #[cfg(all(test, feature = "std"))]).

Why now

  • src/frame.rs was 6,439 lines; the inline test block accounted for 24% of the file. Reviews of frame-layout changes had to scroll past a thousand-plus lines of test code.
  • Per-arch SIMD backends (PR refactor(tests): split inline test mods into sibling tests.rs files + 2 PR #20 review fixes #21) and src/sinker/mixed/mod.rs already use the sibling pattern — these 4 files were the last holdouts.
  • Smaller parent files keep CI diff-stat noise lower for future PRs that touch the implementation but not the tests.

Test plan

  • cargo test --lib: 499 pass, 0 fail (unchanged from before the split — pure layout refactor)
  • cargo check --tests --lib clean across host (aarch64-darwin), x86_64-unknown-freebsd, wasm32-unknown-unknown
  • RUSTFLAGS="-Dwarnings" cargo clippy --lib --tests clean

🤖 Generated with Claude Code

@al8n al8n changed the title cleanup refactor(tests): split remaining inline test mods into sibling tests.rs files Apr 26, 2026
@uqio uqio merged commit 2791193 into main Apr 26, 2026
43 checks passed
@uqio uqio deleted the refactor/split-inline-test-modules branch April 26, 2026 23:01
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