Skip to content

refactor(tests): move the pick tests out of lib.rs - #8

Merged
xarthurx merged 1 commit into
mainfrom
refactor/pick-tests-module
Nov 27, 2026
Merged

xarthurx merged 1 commit into
mainfrom
refactor/pick-tests-module

Conversation

@xarthurx

Copy link
Copy Markdown
Owner

Summary

crates/polyscope/src/lib.rs had 1,967 lines, close to the 2,000-line limit in CLAUDE.md. This PR moves the pick tests at the end of its test module into the child module tests::pick (crates/polyscope/src/tests/pick.rs).

  • The tests and their helpers pixel_of and pick_at_position move without changes, one indentation level less.
  • They keep the shared context lock (setup) and the renderer helpers (LiveRenderer, unique_name, enable_quantity) of the parent module through use super::*;.
  • lib.rs: 1,967 → 1,577 lines. tests/pick.rs: 398 lines, 9 tests.
  • No library code changes.

Tests

Local run on macOS (Metal), Rust 1.100.0:

  • cargo test -p polyscope-rs --lib: 58 passed, 0 failed. The crate had 58 unit tests before the move; 9 of them are now under tests::pick::.
  • cargo fmt --check, cargo clippy -- -D warnings and cargo doc --no-deps --document-private-items with -D warnings pass.
  • cargo clippy -p polyscope-rs --lib --tests reports nothing in tests/pick.rs.

🤖 Generated with Claude Code

`crates/polyscope/src/lib.rs` had 1,967 lines, close to the 2,000-line
limit of the project. The pick tests at the end of its test module, with
their helpers `pixel_of` and `pick_at_position`, move unchanged into the
child module `tests::pick` in `src/tests/pick.rs`. They keep the shared
context lock and renderer helpers of the parent module.

lib.rs now has 1,577 lines. The crate still runs 58 unit tests.
@xarthurx xarthurx closed this Nov 27, 2026
@xarthurx
xarthurx deleted the refactor/pick-tests-module branch November 27, 2026 08:45
@xarthurx
xarthurx restored the refactor/pick-tests-module branch November 27, 2026 08:46
@xarthurx xarthurx reopened this Nov 27, 2026
@xarthurx
xarthurx merged commit 7b47713 into main Nov 27, 2026
10 checks passed
@xarthurx
xarthurx deleted the refactor/pick-tests-module branch November 27, 2026 08:48
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