Tidied up the new BackendPassesTest module, removing some old code that was not intended to be in there, and tidying up the imports list

This commit is contained in:
Neil Brown 2007-09-27 13:13:07 +00:00
parent 8d95b65f00
commit e2ab43af3f

View File

@ -20,51 +20,14 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
module BackendPassesTest (tests) where module BackendPassesTest (tests) where
import Control.Monad.State
import Test.HUnit hiding (State) import Test.HUnit hiding (State)
import Control.Monad.State as CSM
import qualified Data.Map as Map
import qualified AST as A import qualified AST as A
import TestUtil
import Pattern
import TreeUtil
import CompState
import Control.Monad.Error (runErrorT)
import Data.Generics
import Utils
import Errors
import BackendPasses import BackendPasses
import Pattern
skipP :: A.Structured import TestUtil
skipP = A.OnlyP m (A.Skip m) import TreeUtil
castAssertADI :: (Typeable b) => Maybe AnyDataItem -> IO b
castAssertADI x = case (castADI x) of
Just y -> return y
Nothing -> dieInternal (Nothing, "Pattern successfully matched but did not find item afterwards")
{-
testPullUpParDecl0 :: Test
testPullUpParDecl0 = TestCase $ testPass "testPullUpParDecl0" orig (pullUpParDeclarations orig) (return ())
where
orig = A.Par m A.PlainPar (A.Several m [])
testPullUpParDecl1 :: Test
testPullUpParDecl1 = TestCase $ testPass "testPullUpParDecl1" exp (pullUpParDeclarations orig) (return ())
where
orig = A.Par m A.PlainPar $
A.Spec m (A.Specification m (simpleName "x") $ A.Declaration m A.Int) (A.Several m [])
exp = A.Seq m $ A.Spec m (A.Specification m (simpleName "x") $ A.Declaration m A.Int) (A.OnlyP m $ A.Par m A.PlainPar $ A.Several m [])
testPullUpParDecl2 :: Test
testPullUpParDecl2 = TestCase $ testPass "testPullUpParDecl2" exp (pullUpParDeclarations orig) (return ())
where
orig = A.Par m A.PlainPar $
A.Spec m (A.Specification m (simpleName "x") $ A.Declaration m A.Int) $
A.Spec m (A.Specification m (simpleName "y") $ A.Declaration m A.Byte) $
(A.Several m [])
exp = A.Seq m $ A.Spec m (A.Specification m (simpleName "x") $ A.Declaration m A.Int)
$ A.Spec m (A.Specification m (simpleName "y") $ A.Declaration m A.Byte)
(A.OnlyP m $ A.Par m A.PlainPar $ A.Several m [])
-}
-- | Test WaitUntil guard (should be unchanged) -- | Test WaitUntil guard (should be unchanged)
testTransformWaitFor0 :: Test testTransformWaitFor0 :: Test