use anyhow::Result;
use std::path::Path;
pub fn handle_prove_command(
file: Option<&Path>,
backend: &str,
ml_suggestions: bool,
timeout: u64,
script: Option<&Path>,
export: Option<&Path>,
check: bool,
counterexample: bool,
verbose: bool,
format: &str,
) -> Result<()> {
super::handlers_modules::prove::handle_prove_command(
file,
backend,
ml_suggestions,
timeout,
script,
export,
check,
counterexample,
verbose,
format,
)
}
pub fn verify_proofs_from_ast(
ast: &ruchy::frontend::ast::Expr,
file_path: &Path,
format: &str,
counterexample: bool,
verbose: bool,
) -> Result<()> {
super::handlers_modules::prove_helpers::verify_proofs_from_ast(
ast,
file_path,
format,
counterexample,
verbose,
)
}
#[cfg(test)]
mod tests {
use super::*;
use tempfile::TempDir;
#[test]
fn test_prove_handler_stub() {
}
#[test]
fn test_handle_prove_command_no_file() {
let result = handle_prove_command(
None, "default", false, 30, None, None, false, false, false, "text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_nonexistent_file() {
let result = handle_prove_command(
Some(Path::new("/nonexistent/file.ruchy")),
"default",
false,
30,
None,
None,
false,
false,
false,
"text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_with_ml_suggestions() {
let result = handle_prove_command(
None, "default", true, 60, None, None, false, false, false, "text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_check_mode() {
let result = handle_prove_command(
None, "default", false, 30, None, None, true, false, false, "text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_counterexample() {
let result = handle_prove_command(
None, "default", false, 30, None, None, false, true, false, "text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_verbose() {
let result = handle_prove_command(
None, "default", false, 30, None, None, false, false, true, "text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_json_format() {
let result = handle_prove_command(
None, "default", false, 30, None, None, false, false, false, "json",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_various_backends() {
let backends = ["default", "z3", "smt", "custom"];
for backend in &backends {
let result = handle_prove_command(
None, backend, false, 30, None, None, false, false, false, "text",
);
let _ = result;
}
}
#[test]
fn test_handle_prove_command_various_timeouts() {
let timeouts = [1, 10, 30, 60, 300, 3600];
for timeout in &timeouts {
let result = handle_prove_command(
None, "default", false, *timeout, None, None, false, false, false, "text",
);
let _ = result;
}
}
#[test]
fn test_handle_prove_command_with_script() {
let temp_dir = TempDir::new().unwrap();
let script_path = temp_dir.path().join("proof_script.txt");
std::fs::write(&script_path, "intro\napply simplify").unwrap();
let result = handle_prove_command(
None,
"default",
false,
30,
Some(&script_path),
None,
false,
false,
false,
"text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_with_export() {
let temp_dir = TempDir::new().unwrap();
let export_path = temp_dir.path().join("proof_export.txt");
let result = handle_prove_command(
None,
"default",
false,
30,
None,
Some(&export_path),
false,
false,
false,
"text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_all_options() {
let temp_dir = TempDir::new().unwrap();
let file_path = temp_dir.path().join("test.ruchy");
std::fs::write(&file_path, "42").unwrap();
let result = handle_prove_command(
Some(&file_path),
"z3",
true,
120,
None,
None,
true,
true,
true,
"json",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_with_function() {
let temp_dir = TempDir::new().unwrap();
let file_path = temp_dir.path().join("func.ruchy");
std::fs::write(&file_path, "fun add(a, b) { a + b }").unwrap();
let result = handle_prove_command(
Some(&file_path),
"default",
false,
30,
None,
None,
false,
false,
false,
"text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_zero_timeout() {
let result = handle_prove_command(
None, "default", false, 0, None, None, false, false, false, "text",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_all_true_flags() {
let result = handle_prove_command(
None, "default", true, 30, None, None, true, true, true, "json",
);
let _ = result;
}
#[test]
fn test_handle_prove_command_xml_format() {
let result = handle_prove_command(
None, "default", false, 30, None, None, false, false, false, "xml",
);
let _ = result;
}
}