]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Compiling/Functor/Test.hs
Add Gram_Term.
[haskell/symantic.git] / Language / Symantic / Compiling / Functor / Test.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module Compiling.Functor.Test where
3
4 import Test.Tasty
5
6 import Data.Proxy (Proxy(..))
7 import Prelude hiding ((&&), not, (||))
8
9 import Language.Symantic.Typing
10 import Compiling.Term.Test
11 import Compiling.Bool.Test ()
12
13 type Ifaces =
14 [ Proxy (->)
15 , Proxy Bool
16 , Proxy Functor
17 , Proxy Integer
18 , Proxy Maybe
19 ]
20 (==>) = test_compile (Proxy::Proxy Ifaces)
21
22 tests :: TestTree
23 tests = testGroup "Functor"
24 [ "fmap not (Just True)" ==> Right
25 ( ty @Maybe :$ ty @Bool
26 , Just False
27 , "fmap (\\x0 -> not x0) (Just True)")
28 , "not `fmap` Just True" ==> Right
29 ( ty @Maybe :$ ty @Bool
30 , Just False
31 , "fmap (\\x0 -> not x0) (Just True)")
32 , "not <$> Just True" ==> Right
33 ( ty @Maybe :$ ty @Bool
34 , Just False
35 , "fmap (\\x0 -> not x0) (Just True)")
36 , "False <$ Just True" ==> Right
37 ( ty @Maybe :$ ty @Bool
38 , Just False
39 , "False <$ Just True" )
40 ]