packages feed

symantic-lib-0.0.3.20180213: test/HUnit/Functor.hs

{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module HUnit.Functor where

import Test.Tasty
import Data.Proxy (Proxy(..))

import Language.Symantic ()
import Language.Symantic.Lib
import Testing.Compiling

type SS =
 [ Proxy (->)
 , Proxy Bool
 , Proxy Functor
 , Proxy Integer
 , Proxy Maybe
 ]
(==>) = readTe @() @SS

hunits :: TestTree
hunits = testGroup "Functor"
 [ "fmap not (Just True)" ==> Right (tyMaybe tyBool, Just False, "fmap (\\x0 -> not x0) (Just True)")
 , "not `fmap` Just True" ==> Right (tyMaybe tyBool, Just False, "fmap (\\x0 -> not x0) (Just True)")
 , "not <$> Just True"    ==> Right (tyMaybe tyBool, Just False, "(\\x0 -> not x0) <$> Just True")
 , "False <$ Just True"   ==> Right (tyMaybe tyBool, Just False, "False <$ Just True")
 ]