@@ -9,8 +9,10 @@ import LambdaBuffers.Compiler.KindCheck (
99
1010import LambdaBuffers.Compiler.KindCheck.Kind (Kind (KType , (:->:) ))
1111import Test.KindCheck.Errors (testGKindCheckErrors )
12+ import Test.QuickCheck (Arbitrary (arbitrary ), forAll , (===) )
1213import Test.Tasty (TestTree , testGroup )
1314import Test.Tasty.HUnit (assertBool , testCase , (@?=) )
15+ import Test.Tasty.QuickCheck (testProperty )
1416import Test.Utils.CompilerInput (
1517 compilerInput'incoherent ,
1618 compilerInput'maybe ,
@@ -61,7 +63,7 @@ testFolds =
6163 " Test Folds"
6264 [ testGroup
6365 " Test Arrow Folds"
64- [testArrowFold0, testArrowFold1, testArrowFold2, testArrowFold3HK, testArrowFold4HK, testArrowFoldHHK]
66+ [testArrowFold0, testArrowFold1, testArrowFold2, testArrowFold3HK, testArrowFold4HK, testArrowFoldHHK, testFoldWithArrowToTypeTotal ]
6567 ]
6668
6769{-
@@ -175,3 +177,9 @@ testArrowFoldHHK =
175177 testCase " Fold 2 HKT" $
176178 foldWithArrowToType [ty, (ty :->: ty) :->: ty, ty]
177179 @?= (ty :->: (((ty :->: ty) :->: ty) :->: (ty :->: ty)))
180+
181+ testFoldWithArrowToTypeTotal :: TestTree
182+ testFoldWithArrowToTypeTotal =
183+ testProperty " foldWithArrowToType is total" $
184+ forAll arbitrary $
185+ \ ts -> foldWithArrowToType ts === foldWithArrowToType ts
0 commit comments