]> Git — Sourcephile - haskell/symantic.git/blob - Language/LOL/Symantic/Trans/Bool/Const/Test.hs
init
[haskell/symantic.git] / Language / LOL / Symantic / Trans / Bool / Const / Test.hs
1 {-# LANGUAGE OverloadedStrings #-}
2 {-# OPTIONS_GHC -fno-warn-orphans #-}
3
4 module Trans.Bool.Const.Test where
5
6 import Test.Tasty
7 import Test.Tasty.HUnit
8
9 import qualified Expr.Bool.Test as Bool
10 import qualified Repr.String.Test ()
11 import Language.LOL.Symantic.Repr
12 import Language.LOL.Symantic.Trans
13
14 tests :: TestTree
15 tests = testGroup "Const" $
16 let (==>) expr expected =
17 testCase expected $
18 (@?= expected) $
19 string_from_expr (trans_bool_const expr) in
20 [ Bool.e1 ==> "False"
21 , Bool.e2 ==> "True"
22 , Bool.e3 ==> "True"
23 , Bool.e4 ==> "True"
24 , Bool.e5 ==> "!x"
25 , Bool.e6 ==> "(x | y) & !(x & y)"
26 , Bool.e7 ==> "((x | y) & !(x & y) | z) & !(((x | y) & !(x & y)) & z)"
27 , Bool.e8 ==> "(x | !y) & !(x & !y)"
28 ]
29