Add CLI args parsing tests and lib target; fix summary string building

Introduce `src/lib.rs` and library target so integration tests can import `docx_mcp`. Add focused `tests/args_tests.rs` verifying clap flag/env parsing and `SecurityConfig::from_args`/`from_env`. Enable clap `env` feature and guard the binary behind a `build-bin` feature to allow testing without unresolved MCP server deps. Fix `get_summary` to build owned strings safely.

These changes ensure argument options work correctly and are covered by comprehensive tests, independent of heavier integration suites.
This commit is contained in:
Andy
2025-08-11 14:56:20 +08:00
parent 232bc36464
commit ded289451e
5 changed files with 122 additions and 9 deletions
+5 -1
View File
@@ -2,7 +2,11 @@
"permissions": {
"allow": [
"Bash(chmod:*)",
"Bash(cargo build:*)"
"Bash(cargo build:*)",
"Bash(rustc:*)",
"Bash(cargo check:*)",
"Bash(git push:*)",
"Bash(rm:*)"
],
"deny": []
}