]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/test/HUnit/Functor.hs
Move symantic-document to its own Git repository.
[haskell/symantic.git] / symantic-lib / test / HUnit / Functor.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module HUnit.Functor where
3
4 import Test.Tasty
5 import Data.Bool
6 import Data.Either (Either(..))
7 import Data.Functor (Functor)
8 import Data.Maybe (Maybe(..))
9 import Data.Proxy (Proxy(..))
10 import Prelude (Integer)
11
12 import Language.Symantic ()
13 import Language.Symantic.Lib
14 import Testing.Compiling
15
16 type SS =
17 [ Proxy (->)
18 , Proxy Bool
19 , Proxy Functor
20 , Proxy Integer
21 , Proxy Maybe
22 ]
23 (==>) = readTe @() @SS
24
25 hunits :: TestTree
26 hunits = testGroup "Functor"
27 [ "fmap not (Just True)" ==> Right (tyMaybe tyBool, Just False, "fmap (\\x0 -> not x0) (Just True)")
28 , "not `fmap` Just True" ==> Right (tyMaybe tyBool, Just False, "fmap (\\x0 -> not x0) (Just True)")
29 , "not <$> Just True" ==> Right (tyMaybe tyBool, Just False, "(\\x0 -> not x0) <$> Just True")
30 , "False <$ Just True" ==> Right (tyMaybe tyBool, Just False, "False <$ Just True")
31 ]