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