mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
Allow UnusedDef problems in solve tests
This commit is contained in:
parent
20f7243373
commit
41662af399
@ -31,7 +31,7 @@ mod test_solve {
|
||||
constraint,
|
||||
home,
|
||||
interns,
|
||||
problems: can_problems,
|
||||
problems: mut can_problems,
|
||||
..
|
||||
} = can_expr(src);
|
||||
let mut subs = Subs::new(var_store.into());
|
||||
@ -49,6 +49,13 @@ mod test_solve {
|
||||
|
||||
let actual_str = content_to_string(content, &mut subs, home, &interns);
|
||||
|
||||
// Disregard UnusedDef problems, because those are unavoidable when
|
||||
// returning a function from the test expression.
|
||||
can_problems.retain(|prob| match prob {
|
||||
roc_problem::can::Problem::UnusedDef(_, _) => false,
|
||||
_ => true,
|
||||
});
|
||||
|
||||
(unify_problems, can_problems, actual_str)
|
||||
}
|
||||
|
||||
|
@ -17,9 +17,16 @@ mod test_uniq_solve {
|
||||
// HELPERS
|
||||
|
||||
fn infer_eq_help(src: &str) -> (Vec<roc_solve::solve::TypeError>, String) {
|
||||
let (_loc_expr, output, can_problems, mut subs, variable, constraint, home, interns) =
|
||||
let (_loc_expr, output, mut can_problems, mut subs, variable, constraint, home, interns) =
|
||||
uniq_expr(src);
|
||||
|
||||
// Disregard UnusedDef problems, because those are unavoidable when
|
||||
// returning a function from the test expression.
|
||||
can_problems.retain(|prob| match prob {
|
||||
roc_problem::can::Problem::UnusedDef(_, _) => false,
|
||||
_ => true,
|
||||
});
|
||||
|
||||
assert_eq!(can_problems, Vec::new(), "Canonicalization problems");
|
||||
|
||||
assert_correct_variable_usage(&constraint);
|
||||
|
Loading…
Reference in New Issue
Block a user