Add some more tests

This commit is contained in:
Richard Feldman 2019-08-31 21:36:36 -04:00
parent 966bb60766
commit 244735d325

View file

@ -403,6 +403,18 @@ mod test_infer {
// CALLING FUNCTIONS // CALLING FUNCTIONS
#[test]
fn call_returns_num() {
infer_eq(
indoc!(r#"
alwaysFive = \_ -> 5
alwaysFive "stuff"
"#),
"Num.Num *"
);
}
#[test] #[test]
fn call_returns_list() { fn call_returns_list() {
infer_eq( infer_eq(
@ -415,11 +427,23 @@ mod test_infer {
); );
} }
// TODO calling functions
// TODO conditionals // TODO conditionals
// TODO type annotations // TODO type annotations
// TODO BoundTypeVariables // TODO BoundTypeVariables
// #[test]
// fn indirect_always() {
// infer_eq(
// indoc!(r#"
// always = \val -> (\_ -> val)
// alwaysFoo = always "foo"
// alwaysFoo 42
// "#),
// "String.String"
// );
// }
// #[test] // #[test]
// fn identity() { // fn identity() {
// infer_eq( // infer_eq(