Test multiple patterns per branch

This commit is contained in:
Agus Zubiaga 2024-12-14 19:34:29 -03:00
parent 1503ec4751
commit a51ae4d980
No known key found for this signature in database

View file

@ -43,6 +43,18 @@ mod specialize_when {
);
}
#[test]
fn multiple_patterns_per_branch() {
expect_mono_expr_str(
r"
when 123 is
123 | 321 -> 321
_ -> 0
",
"When(Number(I16(123)), Number(I16(123)) | Number(I16(321)) -> Number(I16(321)), Underscore -> Number(I16(0)))"
);
}
#[test]
fn guard() {
expect_mono_expr_str(