]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Compiling/Test.hs
Add tests for Compiling.
[haskell/symantic.git] / Language / Symantic / Compiling / Test.hs
1 {-# LANGUAGE NoMonomorphismRestriction #-}
2 {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
3 module Compiling.Test where
4
5 import Test.Tasty
6
7 import qualified Compiling.Bool.Test as Bool
8 import qualified Compiling.Functor.Test as Functor
9 import qualified Compiling.Applicative.Test as Applicative
10 import qualified Compiling.Foldable.Test as Foldable
11 import qualified Compiling.Map.Test as Map
12
13 import Prelude hiding ((&&), not, (||), (==), id)
14
15 import Language.Symantic.Compiling
16
17 -- * Terms
18 te1 = lam $ \x -> lam $ \y -> (x || y) && not (x && y)
19 te2 = lam $ \x -> lam $ \y -> (x && not y) || (not x && y)
20 te3 = let_ (bool True) $ \x -> x && x
21 te4 = let_ (lam $ \x -> x && x) $ \f -> f .$ bool True
22 te5 = lam $ \x0 -> lam $ \x1 -> x0 && x1
23 te6 = let_ (bool True) id && bool False
24 te7 = lam $ \f -> (f .$ bool True) && bool True
25 te8 = lam $ \f -> f .$ (bool True && bool True)
26
27 -- * Tests
28 tests :: TestTree
29 tests = testGroup "Compiling" $
30 [ Bool.tests
31 , Functor.tests
32 , Applicative.tests
33 , Foldable.tests
34 , Map.tests
35 ]