Clean up
This commit is contained in:
parent
9a9d9458ae
commit
f5836b66dc
@ -448,31 +448,6 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn math_requires_same_types() {
|
|
||||||
let abstract_tree = AbstractSyntaxTree {
|
|
||||||
nodes: [Node::new(
|
|
||||||
Statement::BinaryOperation {
|
|
||||||
left: Box::new(Node::new(Statement::Constant(Value::integer(1)), (0, 1))),
|
|
||||||
operator: Node::new(BinaryOperator::Add, (1, 2)),
|
|
||||||
right: Box::new(Node::new(Statement::Constant(Value::float(1.0)), (3, 4))),
|
|
||||||
},
|
|
||||||
(0, 2),
|
|
||||||
)]
|
|
||||||
.into(),
|
|
||||||
};
|
|
||||||
let mut context = Context::new();
|
|
||||||
let mut analyzer = Analyzer::new(&abstract_tree, &mut context);
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
analyzer.analyze(),
|
|
||||||
Err(AnalyzerError::ExpectedInteger {
|
|
||||||
actual: Node::new(Statement::Constant(Value::float(1.0)), (3, 4)),
|
|
||||||
position: (3, 4)
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn float_plus_integer() {
|
fn float_plus_integer() {
|
||||||
let abstract_tree = AbstractSyntaxTree {
|
let abstract_tree = AbstractSyntaxTree {
|
||||||
|
@ -724,7 +724,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn map_equal() {
|
fn map_equal() {
|
||||||
let input = "{ y = 'foo', } == { y = 'foo', }";
|
let input = "{ y = 'foo' } == { y = 'foo' }";
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
run(input, &mut Context::new()),
|
run(input, &mut Context::new()),
|
||||||
|
Loading…
Reference in New Issue
Block a user