Add tar GNUmakefile target.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Applicative / Test.hs
index 2c0f56e971381c019614919064a649160fd09834..150714abb9b3caa0520e0ec8a827ef3c23a0acb8 100644 (file)
@@ -6,11 +6,11 @@ import Test.Tasty
 import Data.Proxy (Proxy(..))
 import Prelude hiding ((&&), not, (||))
 
-import Language.Symantic.Typing
-import Compiling.Term.Test
+import Language.Symantic.Lib
+import Compiling.Test
 import Lib.Bool.Test ()
 
-type Ifaces =
+type SS =
  [ Proxy (->)
  , Proxy Integer
  , Proxy Bool
@@ -18,28 +18,13 @@ type Ifaces =
  , Proxy Functor
  , Proxy Applicative
  ]
-(==>) = test_compile @Ifaces
+(==>) = readTe @() @SS
 
 tests :: TestTree
 tests = testGroup "Applicative"
- [ "Just (xor True) <*> Just True" ==> Right
-        ( ty @Maybe :$ ty @Bool
-        , Just False
-        , "(\\x0 -> Just ((\\x1 -> (\\x2 -> x1 `xor` x2)) True) <*> x0) (Just True)" )
- , "Just (xor True) <*> Nothing @Bool" ==> Right
-        ( ty @Maybe :$ ty @Bool
-        , Nothing
-        , "(\\x0 -> Just ((\\x1 -> (\\x2 -> x1 `xor` x2)) True) <*> x0) Nothing" )
- , "xor <$> Just True <*> Just False" ==> Right
-        ( ty @Maybe :$ ty @Bool
-        , Just True
-        , "(\\x0 -> fmap (\\x1 -> (\\x2 -> x1 `xor` x2)) (Just True) <*> x0) (Just False)" )
- , "Just False <* Just True" ==> Right
-        ( ty @Maybe :$ ty @Bool
-        , Just False
-        , "Just False <* Just True" )
- , "Just False *> Just True" ==> Right
-        ( ty @Maybe :$ ty @Bool
-        , Just True
-        , "Just False *> Just True" )
+ [ "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")
  ]