Add multi-branch bound pattern solve test

This commit is contained in:
Ayaz Hafiz 2022-07-21 12:22:27 -04:00
parent 92e363f4ef
commit 7fbdbca4c6
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -7359,7 +7359,7 @@ mod solve_expr {
}
#[test]
fn shared_pattern_variable_in_when_branches() {
fn shared_pattern_variable_in_when_patterns() {
infer_queries!(
indoc!(
r#"
@ -7377,4 +7377,29 @@ mod solve_expr {
"###
);
}
#[test]
fn shared_pattern_variable_in_multiple_branch_when_patterns() {
infer_queries!(
indoc!(
r#"
when A "" is
# ^^^^
A x | B x -> x
# ^ ^ ^
C x | D x -> x
# ^ ^ ^
"#
),
@r###"
A "" : [A Str, B Str, C Str, D Str]
x : Str
x : Str
x : Str
x : Str
x : Str
x : Str
"###
);
}
}