1 {-# LANGUAGE OverloadedStrings #-}
2 {-# OPTIONS_GHC -fno-warn-orphans #-}
4 module Trans.Bool.Const.Test where
6 import Data.Function (($))
7 import qualified Data.Text.Lazy as Text
8 import Data.Text.Lazy.Builder as Build
10 import Test.Tasty.HUnit
12 import qualified Expr.Bool.Test as Bool
13 import qualified Repr.Text.Write.Test ()
18 tests = testGroup "Const" $
19 let (==>) expr expected =
20 testCase (Text.unpack expected) $
21 Build.toLazyText (repr_text_write $ trans_bool_const expr) @?=
29 , Bool.e6 ==> "(x | y) & !(x & y)"
30 , Bool.e7 ==> "((x | y) & !(x & y) | z) & !(((x | y) & !(x & y)) & z)"
31 , Bool.e8 ==> "(x | !y) & !(x & !y)"