{-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Trans.Bool.Const.Test where import Test.Tasty import Test.Tasty.HUnit import qualified Data.Text as Text import qualified Expr.Bool.Test as Bool import qualified Repr.Text.Test () import Language.Symantic.Repr import Language.Symantic.Trans tests :: TestTree tests = testGroup "Const" $ let (==>) expr expected = testCase (Text.unpack expected) $ (@?= expected) $ text_from_expr (trans_bool_const expr) in [ Bool.e1 ==> "False" , Bool.e2 ==> "True" , Bool.e3 ==> "True" , Bool.e4 ==> "True" , Bool.e5 ==> "not x" , Bool.e6 ==> "(x || y) && not (x && y)" , Bool.e7 ==> "((x || y) && not (x && y) || z) && not (((x || y) && not (x && y)) && z)" , Bool.e8 ==> "(x || not y) && not (x && not y)" ]