mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Add more tests
This commit is contained in:
parent
5a9109f17b
commit
834f4afe2c
4 changed files with 23 additions and 56 deletions
|
@ -8468,60 +8468,4 @@ mod solve_expr {
|
|||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rank_no_overgeneralization() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
#^^^^{-1}
|
||||
\x ->
|
||||
y = \z -> x z
|
||||
y
|
||||
"#
|
||||
),
|
||||
@"main : (a -[[]]-> b) -[[main(0)]]-> (a -[[y(2) (a -[[]]-> b)]]-> b)"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn when_branch_variables_not_generalized() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main = \{} -> when Red is
|
||||
#^^^^{-1}
|
||||
x ->
|
||||
y : [Red]_
|
||||
y = x
|
||||
|
||||
z : [Red, Green]_
|
||||
z = x
|
||||
|
||||
{y, z}
|
||||
"#
|
||||
),
|
||||
@"main : {}* -[[main(0)]]-> { y : [Green, Red]a, z : [Green, Red]a }"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn weakened_list() {
|
||||
infer_queries!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" provides [main] to "./platform"
|
||||
|
||||
main = []
|
||||
#^^^^{-1}
|
||||
"#
|
||||
),
|
||||
@"main : List w_a"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue