More tests.

This commit is contained in:
2026-11-15 12:02:51 +01:00
parent 964820a780
commit 92675b5b1b
+27 -6
View File
@@ -413,7 +413,7 @@ mod tests {
);
pretty_assertions::assert_eq!(parser.next(), None);
let input = "f(x, y)";
let input = "f(x, 500.0, \"hello\", g(x))";
let lexer = Lexer::new(input);
let mut parser = Parser::new(input, lexer);
pretty_assertions::assert_eq!(
@@ -428,12 +428,33 @@ mod tests {
name: "x".to_string(),
span: Span::new(2, 3),
}),
Expr::Variable(Ident {
name: "y".to_string(),
span: Span::new(5, 6),
}),
Expr::Literal(
LitNumber {
value: 500.0,
span: Span::new(5, 10),
}
.into()
),
Expr::Literal(
LitString {
value: "hello".to_string(),
span: Span::new(12, 19),
}
.into()
),
Expr::FnCall(FnCall {
name: Ident {
name: "g".to_string(),
span: Span::new(21, 22),
},
args: vec![Expr::Variable(Ident {
name: "x".to_string(),
span: Span::new(23, 24),
})],
span: Span::new(21, 25),
})
],
span: Span::new(0, 7),
span: Span::new(0, 26),
}))
);
pretty_assertions::assert_eq!(parser.next(), None);