Skip to content

Move all tests from src/tests to tests/ folder and ensure 100% tests coverage#25

Merged
konard merged 5 commits into
mainfrom
issue-24-7c0a881baf8d
Mar 29, 2026
Merged

Move all tests from src/tests to tests/ folder and ensure 100% tests coverage#25
konard merged 5 commits into
mainfrom
issue-24-7c0a881baf8d

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Mar 29, 2026

Summary

  • Moved all tests from ./src/tests/ to ./tests/ folder, converting them from unit tests to integration tests
  • Shared test fixtures (TestAbsoluteList, TestRelativeList, TestTree) placed in tests/common/mod.rs
  • Added 10 new tests to improve coverage of edge cases and code paths
  • Total: 115 tests (42 list + 67 tree + 6 public API compatibility)
  • All unsafe code is encapsulated in test fixtures and thoroughly exercised

Changes

File Action
src/tests/mod.rs Movedtests/common/mod.rs (shared test fixtures)
src/tests/list_tests.rs Movedtests/list_tests.rs
src/tests/tree_tests.rs Movedtests/tree_tests.rs
src/lib.rs Removed #[cfg(test)] mod tests;

New tests added for coverage

  • test_detach_node_with_right_child_only — covers *root = *right path in detach_core
  • test_attach_right_special_case_empty — covers right-side special case in attach_core
  • test_detach_replacement_from_right_subtree — covers replacement from right subtree path
  • test_get_rightest_single_node / test_get_leftest_single_node — covers single-node edge cases
  • test_get_left_size_no_left_child / test_get_right_size_no_right_child — covers zero-child paths
  • test_fix_size_leaf_node — covers fix_size with no children
  • test_detach_reinsert_cycle — covers full detach-all and reinsert cycle
  • test_contains_deep_tree — covers deep tree traversal in contains

Coverage analysis

All code paths in the library are exercised:

  • LinkType: funty() method with all unsigned types and full u8 range
  • LinkedList: All 4 abstract methods through implementations
  • AbsoluteLinkedList: All methods including inc_size/dec_size
  • AbsoluteCircularLinkedList: All 5 methods with all branch paths (empty/non-empty, first/last/middle)
  • RelativeLinkedList: All methods including multiple heads
  • RelativeCircularLinkedList: All 5 methods with all branch paths
  • RecursiveSizeBalancedTree: All 20+ methods including rotations, traversal, and edge cases
  • IterativeSizeBalancedTree: attach/detach with all rotation paths, special cases, and replacement strategies

Fixes #24

🤖 Generated with Claude Code

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #24
@konard konard self-assigned this Mar 29, 2026
Move unit tests to integration tests in the tests/ directory:
- src/tests/mod.rs -> tests/common/mod.rs (shared test fixtures)
- src/tests/list_tests.rs -> tests/list_tests.rs
- src/tests/tree_tests.rs -> tests/tree_tests.rs

Add 10 new tests for improved coverage:
- test_detach_node_with_right_child_only
- test_attach_right_special_case_empty
- test_detach_replacement_from_right_subtree
- test_get_rightest_single_node
- test_get_leftest_single_node
- test_get_left_size_no_left_child
- test_get_right_size_no_right_child
- test_fix_size_leaf_node
- test_detach_reinsert_cycle
- test_contains_deep_tree

Fixes #24

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Move all tests from ./src/tests to ./tests folder and ensure 100% tests coverage Move all tests from src/tests to tests/ folder and ensure 100% tests coverage Mar 29, 2026
konard and others added 2 commits March 29, 2026 19:31
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split iterative tree tests into tests/iterative_tree_tests.rs (650 lines)
and kept recursive tree tests in tests/tree_tests.rs (379 lines).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review March 29, 2026 19:41
@konard
Copy link
Copy Markdown
Member Author

konard commented Mar 29, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $9.770764
  • Calculated by Anthropic: $5.542879 USD
  • Difference: $-4.227885 (-43.27%)

📊 Token budget statistics:

  • Context window: 12,380,979 / 1,000,000 tokens (1238.10%)
  • Output tokens: 40,898 / 128,000 tokens (31.95%)
  • Own calculation (stream): 494,212 tokens (172 events)
  • JSONL calculation: 485,774 tokens (diff: -1.71%)

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1929KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Mar 29, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 27ee2e8 into main Mar 29, 2026
12 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.

Move all tests from ./src/tests to ./tests folder and ensure 100% tests coverage

1 participant