symantic-lib-0.0.5.20190614: test/HUnit/Foldable.hs
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module HUnit.Foldable where
import Test.Tasty
import Control.Applicative (Applicative)
import Data.Either (Either(..))
import Data.Foldable (Foldable)
import Data.Int (Int)
import Data.Proxy (Proxy(..))
import Prelude (Integer)
import Language.Symantic.Lib
import Testing.Compiling
type SS =
[ Proxy (->)
, Proxy Int
, Proxy Integer
, Proxy []
, Proxy ()
, Proxy (,)
, Proxy Foldable
]
(==>) = readTe @() @SS
hunits :: TestTree
hunits = testGroup "Foldable"
[ {-"[]" ==> Right (tyList (tyVar "a" varZ), [], "[]")
,-} "[1, 2, 3]" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
, "1 : 2 : 3 : []" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
, "foldMap (\\(x0:Integer) -> [x0, x0]) [1, 2, 3]" ==> Right
( tyList tyInteger
, [1, 1, 2, 2, 3, 3]
, "foldMap (\\x0 -> x0 : x0 : []) (1 : 2 : 3 : [])" )
]