]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/Language/Symantic/Lib/Functor/Test.hs
Polish for publication.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Functor / Test.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module Lib.Functor.Test where
3
4 import Test.Tasty
5
6 import Data.Proxy (Proxy(..))
7 import Prelude hiding ((&&), not, (||))
8
9 import Language.Symantic ()
10 import Language.Symantic.Lib
11 import Compiling.Test
12
13 type SS =
14 [ Proxy (->)
15 , Proxy Bool
16 , Proxy Functor
17 , Proxy Integer
18 , Proxy Maybe
19 ]
20 (==>) = test_readTerm @() @SS
21
22 tests :: TestTree
23 tests = testGroup "Functor"
24 [ "fmap not (Just True)" ==> Right (tyMaybe tyBool, Just False, "fmap (\\x0 -> not x0) (Just True)")
25 , "not `fmap` Just True" ==> Right (tyMaybe tyBool, Just False, "fmap (\\x0 -> not x0) (Just True)")
26 , "not <$> Just True" ==> Right (tyMaybe tyBool, Just False, "(\\x0 -> not x0) <$> Just True")
27 , "False <$ Just True" ==> Right (tyMaybe tyBool, Just False, "False <$ Just True")
28 ]