use anyhow::Result;
use std::path::{Path, PathBuf};
pub fn handle_test_command(
path: Option<PathBuf>,
watch: bool,
verbose: bool,
filter: Option<&str>,
coverage: bool,
coverage_format: &str,
parallel: usize,
threshold: f64,
format: &str,
) -> Result<()> {
super::handlers_modules::test::handle_test_command(
path,
watch,
verbose,
filter,
coverage,
coverage_format,
parallel,
threshold,
format,
)
}
pub fn handle_watch_and_test(path: &Path, verbose: bool, filter: Option<&str>) -> Result<()> {
super::handlers_modules::test::handle_test_command(
Some(path.to_path_buf()),
true, verbose,
filter,
false, "text",
1,
0.0,
"text",
)
}
#[allow(clippy::too_many_arguments)]
pub fn handle_run_enhanced_tests(
path: &Path,
verbose: bool,
filter: Option<&str>,
coverage: bool,
coverage_format: &str,
parallel: usize,
threshold: f64,
format: &str,
) -> Result<()> {
super::handlers_modules::test::handle_test_command(
Some(path.to_path_buf()),
false, verbose,
filter,
coverage,
coverage_format,
parallel,
threshold,
format,
)
}
pub fn run_ruchy_test_file(test_file: &Path, verbose: bool) -> Result<()> {
super::handlers_modules::test_helpers::run_test_file(test_file, verbose)
}
#[cfg(test)]
mod tests {
use super::*;
use tempfile::TempDir;
#[test]
fn test_test_handler_stub() {
}
#[test]
fn test_handle_test_command_no_path() {
let result = handle_test_command(None, false, false, None, false, "text", 1, 0.0, "text");
let _ = result;
}
#[test]
fn test_handle_test_command_with_path() {
let temp_dir = TempDir::new().unwrap();
let result = handle_test_command(
Some(temp_dir.path().to_path_buf()),
false,
false,
None,
false,
"text",
1,
0.0,
"text",
);
let _ = result;
}
#[test]
fn test_handle_test_command_watch_mode() {
let temp_dir = TempDir::new().unwrap();
let result = handle_test_command(
Some(temp_dir.path().to_path_buf()),
true, false,
None,
false,
"text",
1,
0.0,
"text",
);
let _ = result;
}
#[test]
fn test_handle_test_command_verbose() {
let result = handle_test_command(
None, false, true, None, false, "text", 1, 0.0, "text",
);
let _ = result;
}
#[test]
fn test_handle_test_command_with_filter() {
let result = handle_test_command(
None,
false,
false,
Some("test_name"), false,
"text",
1,
0.0,
"text",
);
let _ = result;
}
#[test]
fn test_handle_test_command_with_coverage() {
let result = handle_test_command(
None, false, false, None, true, "lcov", 1, 80.0, "text",
);
let _ = result;
}
#[test]
fn test_handle_test_command_json_format() {
let result = handle_test_command(None, false, false, None, false, "text", 1, 0.0, "json");
let _ = result;
}
#[test]
fn test_handle_test_command_parallel() {
let result = handle_test_command(
None, false, false, None, false, "text", 4, 0.0, "text",
);
let _ = result;
}
#[test]
fn test_handle_test_command_threshold() {
let result = handle_test_command(
None, false, false, None, true, "html", 1, 90.0, "text",
);
let _ = result;
}
#[test]
fn test_handle_watch_and_test_basic() {
let temp_dir = TempDir::new().unwrap();
let result = handle_watch_and_test(temp_dir.path(), false, None);
let _ = result;
}
#[test]
fn test_handle_watch_and_test_verbose() {
let temp_dir = TempDir::new().unwrap();
let result = handle_watch_and_test(temp_dir.path(), true, None);
let _ = result;
}
#[test]
fn test_handle_watch_and_test_with_filter() {
let temp_dir = TempDir::new().unwrap();
let result = handle_watch_and_test(temp_dir.path(), false, Some("test_*"));
let _ = result;
}
#[test]
fn test_handle_run_enhanced_tests_basic() {
let temp_dir = TempDir::new().unwrap();
let result =
handle_run_enhanced_tests(temp_dir.path(), false, None, false, "text", 1, 0.0, "text");
let _ = result;
}
#[test]
fn test_handle_run_enhanced_tests_all_options() {
let temp_dir = TempDir::new().unwrap();
let result = handle_run_enhanced_tests(
temp_dir.path(),
true,
Some("integration"),
true,
"html",
8,
75.0,
"json",
);
let _ = result;
}
#[test]
fn test_run_ruchy_test_file_nonexistent() {
let result = run_ruchy_test_file(Path::new("/nonexistent/test.ruchy"), false);
let _ = result;
}
#[test]
fn test_run_ruchy_test_file_verbose() {
let temp_dir = TempDir::new().unwrap();
let test_file = temp_dir.path().join("test.ruchy");
std::fs::write(&test_file, "test basic { assert(1 == 1) }").unwrap();
let result = run_ruchy_test_file(&test_file, true);
let _ = result;
}
}