From 4abe7836e03bf84ff6a94be44bb2367c227bfde6 Mon Sep 17 00:00:00 2001 From: krangelov Date: Thu, 12 Aug 2021 07:53:55 +0200 Subject: [PATCH] test case for functionType --- src/runtime/haskell/tests/basic.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/haskell/tests/basic.hs b/src/runtime/haskell/tests/basic.hs index b8cefd9f0..032913849 100644 --- a/src/runtime/haskell/tests/basic.hs +++ b/src/runtime/haskell/tests/basic.hs @@ -9,4 +9,10 @@ main = do ,TestCase (assertEqual "abstract functions" ["c","s","z"] (functions gr)) ,TestCase (assertEqual "abstract functions by cat 1" ["s","z"] (functionsByCat gr "N")) ,TestCase (assertEqual "abstract functions by cat 2" ["c"] (functionsByCat gr "S")) + ,TestCase (assertBool "type of z" (eqJust (readType "N") (functionType gr "z"))) + ,TestCase (assertBool "type of s" (eqJust (readType "N->N") (functionType gr "s"))) + ,TestCase (assertBool "type of c" (eqJust (readType "N->S") (functionType gr "c"))) ] + +eqJust (Just x) (Just y) = x == y +eqJust _ _ = False