Add more tests

This commit is contained in:
Ayaz Hafiz 2023-03-31 13:56:46 -05:00
parent 5a9109f17b
commit 834f4afe2c
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 23 additions and 56 deletions

View file

@ -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"
);
}
}