tests/scan.rs: 3 tests exercising scan_from_root via the public API —
finds git repos, skips hidden directories, and respects max_depth.
Note: tempfile::tempdir() generates hidden paths (.tmpXXXXXX) on this
system, so each test creates a visible scan_root/ subdirectory to avoid
filter_entry silently skipping the walk root.
tests/session_config.rs: 2 tests for SessionConfig::load_from_project —
loads a .tmuxido.toml written into a temp dir and returns None when the
file is absent.
tests/cache_lifecycle.rs: round-trip test that saves a ProjectCache and
reloads it, verifying the projects list survives serialisation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cache.rs: make minimal_roots pub(crate); add 8 tests covering the
minimal_roots helper (empty input, single root, nested vs sibling dirs)
and validate_and_update (stale project removal, no-change short-circuit,
mtime-triggered rescan, legacy empty dir_mtimes).
session.rs: make session_name pub(crate); add 5 tests covering session
name sanitisation (dots→underscores, spaces→dashes, fallback for root
path) and TOML parsing for Window and SessionConfig with layout.
config.rs: add 3 tests covering serde defaults when optional fields are
absent, full config parsing and invalid TOML rejection.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move scan_from_root, scan_all_roots, get_projects, show_cache_status
and launch_tmux_session from main.rs into a new src/lib.rs, making
them pub so they are testable independently of the binary entrypoint.
main.rs is now a thin entrypoint that imports from tmuxido:: and keeps
only select_project_with_fzf (interactive subprocess, not unit-testable).
Add tempfile = "3" to [dev-dependencies] in preparation for tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add CLAUDE.md with project-specific rules (test structure, naming
conventions, MCP tools reference). Add .mcp.json for rust-mcp and
crates-io MCP servers. Add rust-toolchain.toml pinning stable with
rustfmt and clippy. Add .claude/settings.json with PostToolUse hook
that runs cargo test automatically after every file edit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>