]> Git — Sourcephile - haskell/symantic.git/blob - symantic-lib/Language/Symantic/Lib/Tuple2/Test.hs
Backtrack (try) the grammar only when necessary to get better error messages.
[haskell/symantic.git] / symantic-lib / Language / Symantic / Lib / Tuple2 / Test.hs
1 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
2 {-# OPTIONS_GHC -O0 -fmax-simplifier-iterations=0 #-}
3 module Lib.Tuple2.Test where
4
5 import Test.Tasty
6
7 import Data.Proxy (Proxy(..))
8 import Prelude hiding ((&&), not, (||))
9
10 import Language.Symantic.Typing
11 import Compiling.Term.Test
12
13 type Ifaces =
14 [ Proxy (->)
15 , Proxy Integer
16 , Proxy ()
17 , Proxy (,)
18 ]
19 (==>) = test_compile @Ifaces
20
21 tests :: TestTree
22 tests = testGroup "Tuple2"
23 [ "()" ==> Right (ty @(), (), "()")
24 , "(,) 1 2" ==> Right (ty @(,) :$ ty @Integer :$ ty @Integer, (1,2), "(1, 2)")
25 , "(1,2)" ==> Right (ty @(,) :$ ty @Integer :$ ty @Integer, (1,2), "(1, 2)")
26 , "((1,2), (3,4))" ==> Right
27 ( let t = ty @(,) :$ ty @Integer :$ ty @Integer in ty @(,) :$ t :$ t
28 , ((1,2),(3,4))
29 , "((1, 2), (3, 4))" )
30 ]