From 282a9a6a07ba3a36e4bb310877f21d344f474a47 Mon Sep 17 00:00:00 2001 From: Alex Bethel Date: Thu, 22 Jul 2021 22:27:17 -0500 Subject: [PATCH] Fix broken `type_errors` unit test --- src/interpret.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/interpret.rs b/src/interpret.rs index 5481c1d0..73180564 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -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]