Migrate pattern tests

This commit is contained in:
Ayaz Hafiz 2023-04-02 13:15:36 -05:00
parent 67364e1a42
commit c57aaecad4
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 22 additions and 45 deletions

View file

@ -6334,49 +6334,4 @@ mod solve_expr {
"List (A U8)",
);
}
#[test]
fn shared_pattern_variable_in_when_patterns() {
infer_queries!(
indoc!(
r#"
when A "" is
# ^^^^
A x | B x -> x
# ^ ^ ^
"#
),
@r###"
A "" : [A Str, B Str]
x : Str
x : Str
x : Str
"###
);
}
#[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
"###
);
}
}