Fix broken `type_errors` unit test

pull/43/head
Alex Bethel 2021-07-22 22:27:17 -05:00
parent e5c67a6049
commit 255c28db47
1 changed files with 7 additions and 9 deletions

View File

@ -508,11 +508,11 @@ mod tests {
}
#[test]
fn type_errors() {
// The sum of an integer and a boolean results in a type
// error.
fn type_coercions() {
// The sum of an integer and a boolean causes a boolean
// coercion.
let env = ExecEnv::new();
assert!(matches!(
assert_eq!(
env.eval_expr(&Expr {
kind: ExprKind::BinOp {
lhs: Box::new(Expr {
@ -526,12 +526,10 @@ mod tests {
kind: crate::ast::BinOpKind::Add,
},
span: 1..1
}),
Err(Error {
kind: ErrorKind::TypeError(_),
span: _,
})
));
.unwrap(),
Value::Int(3)
);
}
#[test]