Fix can tests

This commit is contained in:
ayazhafiz 2022-01-23 01:06:53 -05:00
parent 0eede1cd86
commit 095204ec7a

View file

@ -368,9 +368,11 @@ mod test_can {
let arena = Bump::new(); let arena = Bump::new();
let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src); let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src);
assert_eq!(problems.len(), 1); assert_eq!(problems.len(), 2);
assert!(problems.iter().all(|problem| match problem { assert!(problems.iter().all(|problem| match problem {
Problem::RuntimeError(RuntimeError::Shadowing { .. }) => true, Problem::RuntimeError(RuntimeError::Shadowing { .. }) => true,
// Due to one of the shadows
Problem::UnusedDef(..) => true,
_ => false, _ => false,
})); }));
} }
@ -389,9 +391,11 @@ mod test_can {
let arena = Bump::new(); let arena = Bump::new();
let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src); let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src);
assert_eq!(problems.len(), 1); assert_eq!(problems.len(), 2);
assert!(problems.iter().all(|problem| match problem { assert!(problems.iter().all(|problem| match problem {
Problem::RuntimeError(RuntimeError::Shadowing { .. }) => true, Problem::RuntimeError(RuntimeError::Shadowing { .. }) => true,
// Due to one of the shadows
Problem::UnusedDef(..) => true,
_ => false, _ => false,
})); }));
} }
@ -410,10 +414,12 @@ mod test_can {
let arena = Bump::new(); let arena = Bump::new();
let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src); let CanExprOut { problems, .. } = can_expr_with(&arena, test_home(), src);
assert_eq!(problems.len(), 1); assert_eq!(problems.len(), 2);
println!("{:#?}", problems); println!("{:#?}", problems);
assert!(problems.iter().all(|problem| match problem { assert!(problems.iter().all(|problem| match problem {
Problem::RuntimeError(RuntimeError::Shadowing { .. }) => true, Problem::RuntimeError(RuntimeError::Shadowing { .. }) => true,
// Due to one of the shadows
Problem::UnusedDef(..) => true,
_ => false, _ => false,
})); }));
} }