use thiserror::Error;
pub type TestResult<T> = Result<T, TestError>;
#[derive(Error, Debug)]
pub enum TestError {
#[error("Failed to initialize Godot runtime: {0}")]
RuntimeInitialization(String),
#[error("Godot runtime is not available")]
RuntimeNotAvailable,
#[error("Assertion failed: {0}")]
AssertionFailed(String),
#[error("Test failed: {0}")]
TestFailure(String),
#[error("Tests failed: {0}")]
TestsFailed(String),
#[error("Runtime error: {0}")]
RuntimeError(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
}
impl TestError {
pub fn assertion(message: impl Into<String>) -> Self {
Self::AssertionFailed(message.into())
}
pub fn failure(message: impl Into<String>) -> Self {
Self::TestFailure(message.into())
}
}