use r2rust_core::ast::{Expr, Statement}; use r2rust_core::lexer::Token; use r2rust_core::parser::parse; #[cfg(test)] mod tests { use super::*; #[test] fn test_parse_assignment() { let tokens = vec![ Token::Identifier("x".to_string()), Token::Assign, Token::Number(10.0), Token::Plus, Token::Number(20.0), Token::EOF, ]; let ast = parse(&tokens).expect("Failed to parse"); assert_eq!( ast, Statement::Assign( "x".to_string(), Expr::Add(Box::new(Expr::Number(10.0)), Box::new(Expr::Number(20.0))) ) ); } }