]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/test/HUnit/Foldable.hs
Polish 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.Proxy (Proxy(..))
6
7 import Language.Symantic.Lib
8 import Testing.Compiling
9
10 type SS =
11 [ Proxy (->)
12 , Proxy Int
13 , Proxy Integer
14 , Proxy []
15 , Proxy ()
16 , Proxy (,)
17 , Proxy Foldable
18 ]
19 (==>) = readTe @() @SS
20
21 hunits :: TestTree
22 hunits = testGroup "Foldable"
23 [ {-"[]" ==> Right (tyList (tyVar "a" varZ), [], "[]")
24 ,-} "[1, 2, 3]" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
25 , "1 : 2 : 3 : []" ==> Right (tyList tyInteger, [1, 2, 3], "1 : 2 : 3 : []")
26 , "foldMap (\\(x0:Integer) -> [x0, x0]) [1, 2, 3]" ==> Right
27 ( tyList tyInteger
28 , [1, 1, 2, 2, 3, 3]
29 , "foldMap (\\x0 -> x0 : x0 : []) (1 : 2 : 3 : [])" )
30 ]