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