use r2rust_core::environment::Environment; #[cfg(test)] mod tests { use super::*; #[test] fn test_environment_set_and_get() { let mut env = Environment::new(); // Set a variable env.set("x".to_string(), 42.0); // Check if the variable exists and has the correct value assert_eq!(env.get("x"), Some(&42.0)); assert_eq!(env.get("y"), None); // Variable not defined } #[test] fn test_environment_update_variable() { let mut env = Environment::new(); // Set a variable env.set("x".to_string(), 10.0); // Update the variable with a new value env.set("x".to_string(), 20.0); // Ensure the variable reflects the new value assert_eq!(env.get("x"), Some(&20.0)); } }