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