symantic-lib-0.0.3.20180213: test/HUnit/Applicative.hs
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module HUnit.Applicative where
import Test.Tasty
import Data.Proxy (Proxy(..))
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")
]