fix tests
This commit is contained in:
parent
1e889cc604
commit
d3e0f12f69
|
|
@ -213,10 +213,10 @@ mod tests {
|
||||||
Some(ValueInner::Number(arg * arg))
|
Some(ValueInner::Number(arg * arg))
|
||||||
});
|
});
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ast::Expression::Call {
|
ast::Expression::Call(ast::Call {
|
||||||
callee: "sqr".into(),
|
callee: "sqr".into(),
|
||||||
args: vec![ast::Expression::Constant(ast::Constant::Number(7))],
|
args: vec![ast::Expression::Constant(ast::Constant::Number(7))],
|
||||||
}
|
})
|
||||||
.eval(&mut scope),
|
.eval(&mut scope),
|
||||||
Some(49.into())
|
Some(49.into())
|
||||||
);
|
);
|
||||||
|
|
@ -278,13 +278,13 @@ mod tests {
|
||||||
});
|
});
|
||||||
assert_eq!(scope.get("foo"), None);
|
assert_eq!(scope.get("foo"), None);
|
||||||
assert_eq!(scope.get("bar"), None);
|
assert_eq!(scope.get("bar"), None);
|
||||||
ast::Statement::Call {
|
ast::Statement::Call(ast::Call {
|
||||||
callee: "set".into(),
|
callee: "set".into(),
|
||||||
args: vec![
|
args: vec![
|
||||||
ast::Expression::Constant(ast::Constant::String("foo".into())),
|
ast::Expression::Constant(ast::Constant::String("foo".into())),
|
||||||
ast::Expression::Constant(ast::Constant::Number(42)),
|
ast::Expression::Constant(ast::Constant::Number(42)),
|
||||||
],
|
],
|
||||||
}
|
})
|
||||||
.exec(&mut scope);
|
.exec(&mut scope);
|
||||||
assert_eq!(scope.get("foo"), Some(42.into()));
|
assert_eq!(scope.get("foo"), Some(42.into()));
|
||||||
assert_eq!(scope.get("bar"), None);
|
assert_eq!(scope.get("bar"), None);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user