]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/test/HUnit/Foldable.hs
Update to lastest symantic-document
[haskell/symantic.git] / symantic-lib / test / HUnit / Foldable.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module HUnit.Foldable where
3
4 import Test.Tasty
5 import Data.Either (Either(..))
6 import Data.Foldable (Foldable)
7 import Data.Int (Int)
8 import Data.Proxy (Proxy(..))
9 import Prelude (Integer)
10
11 import Language.Symantic.Lib
12 import Testing.Compiling
13
14 type SS =
15 [ Proxy (->)
16 , Proxy Int
17 , Proxy Integer
18 , Proxy []
19 , Proxy ()
20 , Proxy (,)
21 , Proxy Foldable
22 ]
23 (==>) = readTe @() @SS
24
25 hunits :: TestTree
26 hunits = testGroup "Foldable"
27 [ {-"[]" ==> Right (tyList (tyVar "a" varZ), [], "[]")
28 ,-} "[1, 2, 3]" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
29 , "1 : 2 : 3 : []" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
30 , "foldMap (\\(x0:Integer) -> [x0, x0]) [1, 2, 3]" ==> Right
31 ( tyList tyInteger
32 , [1, 1, 2, 2, 3, 3]
33 , "foldMap (\\x0 -> x0 : x0 : []) (1 : 2 : 3 : [])" )
34 ]