]> 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 Data.Text as Text
10
11 import qualified Expr.Bool.Test as Bool
12 import qualified Repr.Text.Test ()
13 import Language.LOL.Symantic.Repr
14 import Language.LOL.Symantic.Trans
15
16 tests :: TestTree
17 tests = testGroup "Const" $
18 let (==>) expr expected =
19 testCase (Text.unpack expected) $
20 (@?= expected) $
21 text_from_expr (trans_bool_const expr) in
22 [ Bool.e1 ==> "False"
23 , Bool.e2 ==> "True"
24 , Bool.e3 ==> "True"
25 , Bool.e4 ==> "True"
26 , Bool.e5 ==> "!x"
27 , Bool.e6 ==> "(x | y) & !(x & y)"
28 , Bool.e7 ==> "((x | y) & !(x & y) | z) & !(((x | y) & !(x & y)) & z)"
29 , Bool.e8 ==> "(x | !y) & !(x & !y)"
30 ]
31