use mecha10_core::error::*;
#[test]
fn test_connection_error_message() {
let err = Mecha10Error::connection_failed("localhost:6379");
let msg = err.to_string();
assert!(msg.contains("localhost:6379"));
assert!(msg.contains("Suggestion:"));
assert!(msg.contains("redis-server"));
}
#[test]
fn test_config_validation_error() {
let err = Mecha10Error::config_validation(
"max_speed",
"Value out of range",
"0.0..=10.0",
"15.0",
"Set max_speed between 0.0 and 10.0",
);
let msg = err.to_string();
assert!(msg.contains("max_speed"));
assert!(msg.contains("Expected: 0.0..=10.0"));
assert!(msg.contains("Got: 15.0"));
assert!(msg.contains("Suggestion:"));
}
#[test]
fn test_model_load_error_with_mlflow() {
let err = Mecha10Error::model_load_failed("mlflow://yolov8-nano/production", "Connection refused");
let msg = err.to_string();
assert!(msg.contains("mlflow://yolov8-nano/production"));
assert!(msg.contains("MLflow"));
assert!(msg.contains("Suggestion:"));
}