#![allow(deprecated)]
#![cfg(not(feature = "skip-slow-tests"))]
use assert_cmd::Command;
use predicates::prelude::*;
#[test]
#[ignore] fn test_help_flag() {
Command::cargo_bin("pmat")
.unwrap()
.arg("--help")
.assert()
.success()
.stdout(predicate::str::contains("Commands:"))
.stdout(predicate::str::contains("analyze"))
.stdout(predicate::str::contains("context"));
}
#[test]
#[ignore] fn test_version_flag() {
Command::cargo_bin("pmat")
.unwrap()
.arg("--version")
.assert()
.success()
.stdout(predicate::str::contains("pmat"));
}
#[test]
#[ignore] fn test_invalid_command() {
Command::cargo_bin("pmat")
.unwrap()
.arg("nonexistent-command")
.assert()
.failure()
.stderr(predicate::str::contains("unrecognized subcommand"));
}
#[test]
#[ignore] fn test_verbose_flag() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--verbose", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_quiet_flag() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--quiet", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_debug_flag() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--debug", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_trace_flag() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--trace", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_trace_filter() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--trace-filter", "pmat=debug", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_color_auto() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--color", "auto", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_color_always() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--color", "always", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_color_never() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--color", "never", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_generate_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["generate", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Template category"));
}
#[test]
#[ignore] fn test_generate_alias_gen() {
Command::cargo_bin("pmat")
.unwrap()
.args(["gen", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_generate_alias_g() {
Command::cargo_bin("pmat")
.unwrap()
.args(["g", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_generate_missing_args() {
Command::cargo_bin("pmat")
.unwrap()
.arg("generate")
.assert()
.failure()
.stderr(predicate::str::contains("required arguments"));
}
#[test]
#[ignore] fn test_scaffold_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["scaffold", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_scaffold_alias_sc() {
Command::cargo_bin("pmat")
.unwrap()
.args(["sc", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_list_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["list", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("toolchain"));
}
#[test]
#[ignore] fn test_list_alias_ls() {
Command::cargo_bin("pmat")
.unwrap()
.args(["ls", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_list_format_table() {
Command::cargo_bin("pmat")
.unwrap()
.args(["list", "--format", "table"])
.assert()
.success();
}
#[test]
#[ignore] fn test_list_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args(["list", "--format", "json"])
.assert()
.success();
}
#[test]
#[ignore] fn test_list_format_yaml() {
Command::cargo_bin("pmat")
.unwrap()
.args(["list", "--format", "yaml"])
.assert()
.success();
}
#[test]
#[ignore] fn test_search_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["search", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("query"));
}
#[test]
#[ignore] fn test_search_alias_find() {
Command::cargo_bin("pmat")
.unwrap()
.args(["find", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_search_alias_s() {
Command::cargo_bin("pmat")
.unwrap()
.args(["s", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_search_with_query() {
Command::cargo_bin("pmat")
.unwrap()
.args(["search", "rust"])
.assert()
.success();
}
#[test]
#[ignore] fn test_search_with_limit() {
Command::cargo_bin("pmat")
.unwrap()
.args(["search", "test", "--limit", "5"])
.assert()
.success();
}
#[test]
#[ignore = "help text needs update"]
fn test_validate_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["validate", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("uri"));
}
#[test]
#[ignore] fn test_validate_missing_uri() {
Command::cargo_bin("pmat")
.unwrap()
.arg("validate")
.assert()
.failure();
}
#[test]
#[ignore] fn test_context_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["context", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("project-path"));
}
#[test]
#[ignore] fn test_context_alias_ctx() {
Command::cargo_bin("pmat")
.unwrap()
.args(["ctx", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_context_alias_ast() {
Command::cargo_bin("pmat")
.unwrap()
.args(["ast", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "CLI integration test - requires binary"]
fn test_context_default_path() {
Command::cargo_bin("pmat")
.unwrap()
.arg("context")
.assert()
.success();
}
#[test]
#[ignore = "CLI integration test - requires binary"]
fn test_context_with_path() {
Command::cargo_bin("pmat")
.unwrap()
.args(["context", "--project-path", "."])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"))
.stdout(predicate::str::contains("complexity"))
.stdout(predicate::str::contains("satd"))
.stdout(predicate::str::contains("dead-code"));
}
#[test]
#[ignore = "error handling needs improvement"]
fn test_analyze_missing_subcommand() {
Command::cargo_bin("pmat")
.unwrap()
.arg("analyze")
.assert()
.failure()
.stderr(predicate::str::contains("required"));
}
#[test]
#[ignore = "help text needs update"]
fn test_analyze_complexity_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "complexity", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("project-path"));
}
#[test]
#[ignore] fn test_analyze_complexity_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "complexity", "--project-path", "."])
.assert()
.success()
.stdout(predicate::str::contains("Files analyzed"));
}
#[test]
#[ignore] fn test_analyze_complexity_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args([
"analyze",
"complexity",
"--project-path",
".",
"--format",
"json",
])
.assert()
.success();
}
#[test]
#[ignore = "text format not supported"]
fn test_analyze_complexity_format_text() {
Command::cargo_bin("pmat")
.unwrap()
.args([
"analyze",
"complexity",
"--project-path",
".",
"--format",
"text",
])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_complexity_format_sarif() {
Command::cargo_bin("pmat")
.unwrap()
.args([
"analyze",
"complexity",
"--project-path",
".",
"--format",
"sarif",
])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_satd_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "satd", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("path"));
}
#[test]
#[ignore] fn test_analyze_satd_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "satd", "--path", "."])
.assert()
.success()
.stdout(predicate::str::contains("SATD"));
}
#[test]
#[ignore] fn test_analyze_satd_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "satd", "--path", ".", "--format", "json"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_satd_format_summary() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "satd", "--path", ".", "--format", "summary"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_dead_code_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "dead-code", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("path"));
}
#[test]
#[ignore = "CLI integration test - requires binary"]
fn test_analyze_dead_code_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "dead-code", "--path", "."])
.assert()
.success()
.stdout(predicate::str::contains("Dead"));
}
#[test]
#[ignore = "CLI integration test - requires binary"]
fn test_analyze_dead_code_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "dead-code", "--path", ".", "--format", "json"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_churn_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "churn", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("path"));
}
#[test]
#[ignore = "churn analysis not yet implemented"]
fn test_analyze_churn_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "churn", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore = "churn analysis not yet implemented"]
fn test_analyze_churn_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "churn", "--path", ".", "--format", "json"])
.assert()
.success();
}
#[test]
#[ignore = "churn analysis not yet implemented"]
fn test_analyze_churn_with_days() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "churn", "--path", ".", "--days", "30"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_dag_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "dag", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "execution path needs fixing"]
fn test_analyze_dag_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "dag", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_tdg_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "tdg", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "TDG fails on examples with unwrap() - expected behavior"]
fn test_analyze_tdg_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "tdg", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore = "TDG fails on examples with unwrap() - expected behavior"]
fn test_analyze_tdg_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "tdg", "--path", ".", "--format", "json"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_deep_context_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "deep-context", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "execution path needs fixing"]
fn test_analyze_deep_context_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "deep-context", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_duplicates_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "duplicates", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "execution path needs fixing"]
fn test_analyze_duplicates_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "duplicates", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_provability_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "provability", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "execution path needs fixing"]
fn test_analyze_provability_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "provability", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_makefile_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "makefile", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_lint_hotspot_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "lint-hotspot", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_comprehensive_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "comprehensive", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "execution path needs fixing"]
fn test_analyze_comprehensive_current_dir() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "comprehensive", "--path", "."])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_graph_metrics_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "graph-metrics", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_name_similarity_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "name-similarity", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "help text needs update"]
fn test_analyze_symbol_table_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "symbol-table", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_big_o_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "big-o", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_entropy_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "entropy", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_clippy_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "clippy", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "help text needs update"]
fn test_quality_gate_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["quality-gate", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("strict"));
}
#[test]
#[ignore] fn test_quality_gate_default() {
Command::cargo_bin("pmat")
.unwrap()
.arg("quality-gate")
.assert()
.code(predicate::in_iter([0, 1, 2])); }
#[test]
#[ignore] fn test_quality_gate_strict() {
Command::cargo_bin("pmat")
.unwrap()
.args(["quality-gate", "--strict"])
.assert()
.code(predicate::in_iter([0, 1, 2]));
}
#[test]
#[ignore] fn test_demo_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["demo", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("protocol"));
}
#[test]
#[ignore] fn test_diagnose_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["diagnose", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_memory_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["memory", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_cache_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["cache", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_agent_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["agent", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore = "config command structure differs"]
fn test_config_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["config", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_tdg_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["tdg", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_hooks_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["hooks", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_embed_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["embed", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_semantic_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["semantic", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_refactor_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["refactor", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_report_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["report", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_validate_docs_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["validate-docs", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_validate_readme_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["validate-readme", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_roadmap_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["roadmap", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_qdd_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["qdd", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_enforce_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["enforce", "--help"])
.assert()
.success()
.stdout(predicate::str::contains("Commands:"));
}
#[test]
#[ignore] fn test_memory_stats_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["memory", "stats", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_memory_cleanup_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["memory", "cleanup", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "memory flush subcommand not implemented"]
fn test_memory_flush_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["memory", "flush", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "cache clear subcommand not implemented"]
fn test_cache_clear_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["cache", "clear", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "cache diagnostics subcommand not implemented"]
fn test_cache_diagnostics_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["cache", "diagnostics", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "config get subcommand not implemented"]
fn test_config_get_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["config", "get", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_tdg_baseline_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["tdg", "baseline", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_tdg_check_regression_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["tdg", "check-regression", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_tdg_check_quality_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["tdg", "check-quality", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_agent_start_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["agent", "start", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_telemetry_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["telemetry", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_test_command_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["test", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_serve_command_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["serve", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "mutate requires mutation-testing feature"]
fn test_mutate_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["mutate", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_debug_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["debug", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "replay command not implemented"]
fn test_replay_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["replay", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "init command not implemented"]
fn test_init_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["init", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_show_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["show", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "health command not implemented"]
fn test_health_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["health", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_quality_gates_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["quality-gates", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_maintain_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["maintain", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_defect_prediction_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "defect-prediction", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_proof_annotations_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "proof-annotations", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_incremental_coverage_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "incremental-coverage", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_assembly_script_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "assembly-script", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "help text needs update"]
fn test_analyze_webassembly_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "webassembly", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_topics_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "topics", "--help"])
.assert()
.success();
}
#[test]
#[ignore] fn test_analyze_cluster_help() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "cluster", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "CSV format for complexity not implemented"]
fn test_complexity_format_csv() {
Command::cargo_bin("pmat")
.unwrap()
.args([
"analyze",
"complexity",
"--project-path",
".",
"--format",
"csv",
])
.assert()
.success();
}
#[test]
#[ignore = "CSV format for SATD not implemented"]
fn test_satd_format_csv() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "satd", "--path", ".", "--format", "csv"])
.assert()
.success();
}
#[test]
#[ignore = "error handling needs improvement"]
fn test_analyze_complexity_nonexistent_path() {
Command::cargo_bin("pmat")
.unwrap()
.args([
"analyze",
"complexity",
"--project-path",
"/nonexistent/path",
])
.assert()
.failure();
}
#[test]
#[ignore = "error handling needs improvement"]
fn test_analyze_satd_nonexistent_path() {
Command::cargo_bin("pmat")
.unwrap()
.args(["analyze", "satd", "--path", "/nonexistent/path"])
.assert()
.failure();
}
#[test]
#[ignore = "CLI integration test - requires binary"]
fn test_context_format_json() {
Command::cargo_bin("pmat")
.unwrap()
.args(["context", "--project-path", ".", "--format", "json"])
.assert()
.success();
}
#[test]
#[ignore = "YAML format for context not fully supported"]
fn test_context_format_yaml() {
Command::cargo_bin("pmat")
.unwrap()
.args(["context", "--project-path", ".", "--format", "yaml"])
.assert()
.success();
}
#[test]
#[ignore] fn test_verbose_debug_combination() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--verbose", "--debug", "--help"])
.assert()
.success();
}
#[test]
#[ignore = "flag conflict detection not implemented"]
fn test_quiet_conflicts_with_verbose() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--quiet", "--verbose", "--help"])
.assert()
.failure()
.stderr(predicate::str::contains("cannot be used with"));
}
#[test]
#[ignore] fn test_all_find_aliases_work() {
for alias in &["search", "find", "s"] {
Command::cargo_bin("pmat")
.unwrap()
.args([alias, "--help"])
.assert()
.success();
}
}
#[test]
#[ignore] fn test_all_generate_aliases_work() {
for alias in &["generate", "gen", "g"] {
Command::cargo_bin("pmat")
.unwrap()
.args([alias, "--help"])
.assert()
.success();
}
}
#[test]
#[ignore] fn test_all_context_aliases_work() {
for alias in &["context", "ctx", "ast"] {
Command::cargo_bin("pmat")
.unwrap()
.args([alias, "--help"])
.assert()
.success();
}
}
#[test]
#[ignore] fn test_analyze_complexity_with_all_options() {
Command::cargo_bin("pmat")
.unwrap()
.args([
"--verbose",
"analyze",
"complexity",
"--project-path",
".",
"--format",
"json",
])
.assert()
.success();
}
#[test]
#[ignore] fn test_quality_gate_with_debug() {
Command::cargo_bin("pmat")
.unwrap()
.args(["--debug", "quality-gate"])
.assert()
.code(predicate::in_iter([0, 1, 2]));
}