lambdust 0.1.1

A Scheme dialect with gradual typing and effect systems
use crate::eval::monadic_architecture::MonadicEvaluationResult;
use crate::diagnostics::Result;
use super::{TestScenario, TestAssertion};
use std::collections::HashMap;

/// Result of executing a test scenario
#[derive(Debug)]
pub struct TestResult {
    /// The scenario that was executed
    pub scenario: TestScenario,
    
    /// Result of the evaluation
    pub execution_result: Result<MonadicEvaluationResult>,
    
    /// Time taken to execute
    pub execution_time_ms: u64,
    
    /// Assertions that passed
    pub assertions_passed: Vec<TestAssertion>,
    
    /// Assertions that failed
    pub assertions_failed: Vec<TestAssertion>,
    
    /// Mock call counts for verification
    pub mock_call_counts: HashMap<String, usize>,
}

impl TestResult {
    /// Check if the test passed
    pub fn passed(&self) -> bool {
        self.assertions_failed.is_empty() && self.execution_result.is_ok()
    }
    
    /// Get a summary of the test result
    pub fn summary(&self) -> String {
        format!(
            "Test '{}': {} ({}ms, {}/{} assertions passed)",
            self.scenario.name,
            if self.passed() { "PASSED" } else { "FAILED" },
            self.execution_time_ms,
            self.assertions_passed.len(),
            self.assertions_passed.len() + self.assertions_failed.len()
        )
    }
}