mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Restore some inference tests
This commit is contained in:
parent
a09eb41a92
commit
dc95c848c3
1 changed files with 54 additions and 50 deletions
|
@ -461,18 +461,20 @@ mod test_infer {
|
|||
// TODO BoundTypeVariables
|
||||
// TODO conditionals
|
||||
|
||||
// #[test]
|
||||
// fn indirect_always() {
|
||||
// infer_eq(
|
||||
// indoc!(r#"
|
||||
// always = \val -> (\_ -> val)
|
||||
// alwaysFoo = always "foo"
|
||||
#[test]
|
||||
fn indirect_always() {
|
||||
infer_eq(
|
||||
indoc!(
|
||||
r#"
|
||||
always = \val -> (\_ -> val)
|
||||
alwaysFoo = always "foo"
|
||||
|
||||
// alwaysFoo 42
|
||||
// "#),
|
||||
// "Str"
|
||||
// );
|
||||
// }
|
||||
alwaysFoo 42
|
||||
"#
|
||||
),
|
||||
"Str",
|
||||
);
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn identity() {
|
||||
|
@ -508,49 +510,51 @@ mod test_infer {
|
|||
// );
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// fn basic_float_division() {
|
||||
// infer_eq(
|
||||
// indoc!(
|
||||
// r#"
|
||||
// 1 / 2
|
||||
// "#
|
||||
// ),
|
||||
// "Float",
|
||||
// );
|
||||
// }
|
||||
// #[test]
|
||||
// fn basic_float_division() {
|
||||
// infer_eq(
|
||||
// indoc!(
|
||||
// r#"
|
||||
// 1 / 2
|
||||
// "#
|
||||
// ),
|
||||
// "Float",
|
||||
// );
|
||||
// }
|
||||
|
||||
#[test]
|
||||
fn basic_int_division() {
|
||||
infer_eq(
|
||||
indoc!(
|
||||
r#"
|
||||
1 // 2
|
||||
"#
|
||||
),
|
||||
"Int",
|
||||
);
|
||||
}
|
||||
// #[test]
|
||||
// fn basic_int_division() {
|
||||
// infer_eq(
|
||||
// indoc!(
|
||||
// r#"
|
||||
// 1 // 2
|
||||
// "#
|
||||
// ),
|
||||
// "Int",
|
||||
// );
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// fn basic_addition() {
|
||||
// infer_eq(
|
||||
// indoc!(
|
||||
// r#"
|
||||
// 1 + 2
|
||||
// "#
|
||||
// ),
|
||||
// "Num *",
|
||||
// );
|
||||
// }
|
||||
// #[test]
|
||||
// fn basic_addition() {
|
||||
// infer_eq(
|
||||
// indoc!(
|
||||
// r#"
|
||||
// 1 + 2
|
||||
// "#
|
||||
// ),
|
||||
// "Int",
|
||||
// );
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// fn basic_circular_type() {
|
||||
// assert_eq!(
|
||||
// infer(indoc!(r#"
|
||||
// infer_eq(
|
||||
// indoc!(
|
||||
// r#"
|
||||
// \x -> x x
|
||||
// "#)),
|
||||
// Erroneous(Problem::CircularType)
|
||||
// "#
|
||||
// ),
|
||||
// "<Type Mismatch: Circular Type>",
|
||||
// );
|
||||
// }
|
||||
|
||||
|
@ -583,8 +587,8 @@ mod test_infer {
|
|||
indoc!(
|
||||
r#"
|
||||
case 1 when
|
||||
1 -> 2
|
||||
3 -> 4
|
||||
1 -> 2
|
||||
3 -> 4
|
||||
"#
|
||||
),
|
||||
"Int",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue