godot-testability-runtime 0.1.2

Embedded Godot runtime for comprehensive Rust testing
Documentation
//! Error types for the testability framework.

use thiserror::Error;

/// Result type for test operations.
pub type TestResult<T> = Result<T, TestError>;

/// Errors that can occur during embedded testing.
#[derive(Error, Debug)]
pub enum TestError {
    /// Runtime initialization failed.
    #[error("Failed to initialize Godot runtime: {0}")]
    RuntimeInitialization(String),

    /// Runtime is not available or not running.
    #[error("Godot runtime is not available")]
    RuntimeNotAvailable,

    /// Assertion failed during test.
    #[error("Assertion failed: {0}")]
    AssertionFailed(String),

    /// Generic test failure with custom message.
    #[error("Test failed: {0}")]
    TestFailure(String),

    /// Multiple tests failed.
    #[error("Tests failed: {0}")]
    TestsFailed(String),

    /// Runtime error.
    #[error("Runtime error: {0}")]
    RuntimeError(String),

    /// I/O error during test operations.
    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),
}

impl TestError {
    /// Create a new assertion failed error.
    pub fn assertion(message: impl Into<String>) -> Self {
        Self::AssertionFailed(message.into())
    }

    /// Create a new test failure error.
    pub fn failure(message: impl Into<String>) -> Self {
        Self::TestFailure(message.into())
    }
}