symantic-lib-0.0.2.20170703: Language/Symantic/Lib/Foldable/Test.hs
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module Lib.Foldable.Test where
import Test.Tasty
import Data.Proxy (Proxy(..))
import Prelude hiding ((&&), not, (||))
import Language.Symantic.Lib
import Compiling.Test
type SS =
[ Proxy (->)
, Proxy Int
, Proxy Integer
, Proxy []
, Proxy ()
, Proxy (,)
, Proxy Foldable
]
(==>) = readTe @() @SS
tests :: TestTree
tests = 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 : [])" )
]