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