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