Skip to content

Commit

Permalink
fix type check test
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Sep 7, 2024
1 parent 8d2f1b8 commit bbbada3
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2786,7 +2786,7 @@ mod tests {
expr: &Expression,
) -> Result<ty::TyExpression, ErrorEmitted> {
let engines = Engines::default();
do_type_check(
let expr = do_type_check(
handler,
&engines,
expr,
Expand All @@ -2806,7 +2806,9 @@ mod tests {
ExperimentalFlags {
new_encoding: false,
},
)
)?;
expr.type_check_analyze(handler, &mut TypeCheckAnalysisContext::new(&engines))?;
Ok(expr)
}

#[test]
Expand Down Expand Up @@ -2867,21 +2869,14 @@ mod tests {
let _comp_res = do_type_check_for_boolx2(&handler, &expr);
let (errors, _warnings) = handler.consume();

assert!(errors.len() == 2);
assert!(errors.len() == 1);
assert!(matches!(&errors[0],
CompileError::TypeError(TypeError::MismatchedType {
expected,
received,
..
}) if expected == "bool"
&& received == "u64"));
assert!(matches!(&errors[1],
CompileError::TypeError(TypeError::MismatchedType {
expected,
received,
..
}) if expected == "[bool; 2]"
&& received == "[u64; 2]"));
}

#[test]
Expand Down

0 comments on commit bbbada3

Please sign in to comment.