mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Migrate pattern tests
This commit is contained in:
parent
67364e1a42
commit
c57aaecad4
3 changed files with 22 additions and 45 deletions
|
@ -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
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue