Repository navigation
refactor(tests): move the pick tests out of lib.rs - #8
Merged
Merged
Conversation
`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.
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.
Summary
crates/polyscope/src/lib.rshad 1,967 lines, close to the 2,000-line limit inCLAUDE.md. This PR moves the pick tests at the end of its test module into the child moduletests::pick(crates/polyscope/src/tests/pick.rs).pixel_ofandpick_at_positionmove without changes, one indentation level less.setup) and the renderer helpers (LiveRenderer,unique_name,enable_quantity) of the parent module throughuse super::*;.lib.rs: 1,967 → 1,577 lines.tests/pick.rs: 398 lines, 9 tests.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 undertests::pick::.cargo fmt --check,cargo clippy -- -D warningsandcargo doc --no-deps --document-private-itemswith-D warningspass.cargo clippy -p polyscope-rs --lib --testsreports nothing intests/pick.rs.🤖 Generated with Claude Code