@@ -29,6 +29,7 @@ spec = describe "Infers types correctly" $ do
29
29
lambdaTests
30
30
letInTests
31
31
ifElseTests
32
+ recursionTests
32
33
it " infers literals" prop_literalTypesInvariants
33
34
Unify. spec
34
35
@@ -48,7 +49,7 @@ literalTests = describe "Literal Type Inference" $ do
48
49
$ (shouldMatch [p |(Scalar ScalarFloat)|]) ty
49
50
50
51
lambdaTests :: Spec
51
- lambdaTests = describe " Lambda Type Inference" $ do
52
+ lambdaTests = withoutRetries $ describe " Lambda Type Inference" $ do
52
53
it " infers lambda type correctly" $ do
53
54
let expr = loadShuntedExpr " \\ x -> x"
54
55
res <- pipelineResShouldSucceed expr
@@ -67,13 +68,13 @@ lambdaTests = describe "Lambda Type Inference" $ do
67
68
68
69
expr === Scalar ScalarInt
69
70
70
- withoutRetries $ it " infers nested identity function correctly" $ property $ do
71
+ it " infers nested identity function correctly" $ property $ do
71
72
expr <- inferFully " (\\ x -> (\\ y -> y) x) 42"
72
73
73
74
expr === Scalar ScalarInt
74
75
75
76
letInTests :: Spec
76
- letInTests = describe " Let In Type Inference" $ do
77
+ letInTests = withoutRetries $ describe " Let In Type Inference" $ do
77
78
it " infers let in type correctly" $ property $ do
78
79
expr <- inferFully " let x = 42 in x"
79
80
@@ -89,18 +90,19 @@ letInTests = describe "Let In Type Inference" $ do
89
90
90
91
expr === Scalar ScalarInt
91
92
93
+ recursionTests :: Spec
94
+ recursionTests = withoutRetries $ describe " recursion tests" $ do
92
95
it " recursion" $ property $ do
93
96
expr <- inferFully " let loop x = if x == 0 then x else loop (x - 1) in loop"
94
97
95
- expr === Scalar ScalarInt
98
+ expr === Function ( Scalar ScalarInt ) ( Scalar ScalarInt )
96
99
97
100
ifElseTests :: Spec
98
101
ifElseTests = describe " If Else Type Inference" $ do
99
102
it " infers if else type correctly" $ property $ do
100
103
expr <- inferFully " if True then 42 else 43"
101
104
102
105
expr === Scalar ScalarInt
103
-
104
106
105
107
inferFully exprSrc = do
106
108
let expr = loadShuntedExpr exprSrc
0 commit comments