packages feed

symantic-lib-0.0.5.20190614: test/HUnit/Applicative.hs

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

import Test.Tasty
import Control.Applicative (Applicative)
import Data.Bool
import Data.Either (Either(..))
import Data.Functor (Functor)
import Data.Maybe (Maybe(..))
import Data.Proxy (Proxy(..))
import Prelude (Integer)

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

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

hunits :: TestTree
hunits = testGroup "Applicative"
 [ "Just (xor True) <*> Just True"    ==> Right (tyMaybe tyBool, Just False, "Just (\\x0 -> True `xor` x0) <*> Just True")
 , "Just (xor True) <*> Nothing"      ==> Right (tyMaybe tyBool, Nothing   , "Just (\\x0 -> True `xor` x0) <*> Nothing")
 , "xor <$> Just True <*> Just False" ==> Right (tyMaybe tyBool, Just True , "(\\x0 -> (\\x1 -> x0 `xor` x1)) <$> Just True <*> Just False")
 , "Just False <* Just True"          ==> Right (tyMaybe tyBool, Just False, "Just False <* Just True")
 , "Just False *> Just True"          ==> Right (tyMaybe tyBool, Just True , "Just False *> Just True")
 ]