Skip to content

Conversation

@umpire274
Copy link
Owner

✨ Summary

This PR marks a major structural milestone for Librius, completing the first phase of the roadmap (v0.5.x):
the implementation of a comprehensive test suite and a full CLI modular refactor.

The CLI is now cleanly separated into logical components (args.rs, dispatch.rs, mod.rs) and all test code has been consolidated under /tests, providing a solid foundation for future releases, including the upcoming librius_core crate and GUI frontend.


πŸ§ͺ Added

  • Complete automated test suite for both database and CLI layers.
  • Implemented setup_temp_db() utility for creating temporary SQLite databases cross-platform:
    • Windows β†’ %TEMP%\librius_test_*.db
    • macOS / Linux β†’ /tmp/librius_test_*.db
  • Added unit tests for database insert/search operations using the full production schema.
  • Added integration tests for:
    • CLI commands (--help, search, etc.) via assert_cmd and predicates.
    • Database schema validation and ISBN normalization.
  • All test modules now use the real production schema for accurate, reproducible results.

πŸ”§ Changed

  • Refactored the CLI architecture into a modular structure:
    • cli/args.rs β†’ defines commands, subcommands, and global options.
    • cli/dispatch.rs β†’ handles parsing and subcommand execution.
    • cli/mod.rs β†’ acts as unified entry point, exporting build_cli(), run_cli(), and parse_cli().
  • Removed the legacy monolithic cli.rs and migrated remaining logic into mod.rs.
  • Simplified command routing and improved maintainability.
  • Enhanced localization consistency and display order of subcommands.

🧱 Internal

  • Removed obsolete #[cfg(test)] modules from isbn.rs and lib.rs.
  • Consolidated all test files under /tests/ for a cleaner and unified structure.
  • Resolved all Clippy and build warnings.
  • Verified cross-platform behavior (Windows, macOS, Linux).
  • Established the foundation for upcoming multi-platform CI automation in v0.5.1.

βœ… Testing

  • Executed full test suite on Windows, macOS, and Linux.
  • Verified database and CLI integration via cargo test -- --nocapture.
  • Confirmed zero Clippy warnings and stable builds on all platforms.

πŸ“¦ Version

Release: v0.5.0
Date: 2025-11-11

…st suite (v0.5.0)

### Added
- Introduced a comprehensive automated test suite for both CLI and
database layers.
- Implemented `setup_temp_db()` utility creating temporary SQLite
databases in the system temp directory:
  - Windows β†’ %TEMP%\librius_test_*.db
  - macOS/Linux β†’ /tmp/librius_test_*.db
- Added unit tests for database insert/search operations using the real
production schema.
- Added integration tests for CLI commands (help, search, etc.) with
`assert_cmd` and `predicates`.

### Changed
- Fully refactored CLI into a modular structure:
  - `cli/args.rs` β†’ defines all commands, subcommands, and global
options.
  - `cli/dispatch.rs` β†’ handles argument parsing and command routing.
  - `cli/mod.rs` β†’ unified entry point, exports `build_cli()`,
`run_cli()`, and `parse_cli()`.
- Removed legacy `cli.rs` monolith and migrated remaining logic to
`mod.rs`.
- Improved code readability, testability, and future reusability for the
upcoming GUI and `librius_core` integration.

### Internal
- Removed obsolete in-source `#[cfg(test)]` modules from `isbn.rs` and
`lib.rs`.
- Reorganized all test files under `/tests/` for a cleaner structure.
- Verified cross-platform behavior (Windows, macOS, Linux).
- All Clippy and build warnings resolved.
@umpire274 umpire274 self-assigned this Nov 11, 2025
@umpire274 umpire274 added the enhancement New feature or request label Nov 11, 2025
@umpire274 umpire274 merged commit 60f5db4 into main Nov 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants