]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/Language/Symantic/Lib/Tuple2/Test.hs
Sync with ghc-8.2.2 and megaparsec-6.3.0.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Tuple2 / Test.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 module Lib.Tuple2.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 Integer
14 , Proxy ()
15 , Proxy (,)
16 ]
17 (==>) = readTe @() @SS
18
19 tests :: TestTree
20 tests = testGroup "Tuple2"
21 [ "()" ==> Right (tyUnit, (), "()")
22 , "(,) 1 2" ==> Right (tyTuple2 tyInteger tyInteger, (1,2), "(1, 2)")
23 , "(1,2)" ==> Right (tyTuple2 tyInteger tyInteger, (1,2), "(1, 2)")
24 , "((1,2), (3,4))" ==> Right
25 ( let t = tyTuple2 tyInteger tyInteger in tyTuple2 t t
26 , ((1,2),(3,4))
27 , "((1, 2), (3, 4))" )
28 ]