use r2rust_core::ast::{Expr, Statement}; use r2rust_core::environment::Environment; use r2rust_core::evaluator::evaluate; #[cfg(test)] mod tests { use super::*; #[test] fn test_evaluate_assignment() { let mut env = Environment::new(); let statement = Statement::Assign( "x".to_string(), Expr::Add(Box::new(Expr::Number(10.0)), Box::new(Expr::Number(20.0))), ); let result = evaluate(statement, &mut env).expect("Failed to evaluate"); assert_eq!(result, 30.0); assert_eq!(env.get("x"), Some(&30.0)); } }