]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Trans/Bool/Const/Test.hs
polish code
[haskell/symantic.git] / Language / 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.Symantic.Repr
14 import Language.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 ==> "not x"
27 , Bool.e6 ==> "(x || y) && not (x && y)"
28 , Bool.e7 ==> "((x || y) && not (x && y) || z) && not (((x || y) && not (x && y)) && z)"
29 , Bool.e8 ==> "(x || not y) && not (x && not y)"
30 ]
31