From e2ab43af3ff5c67f7d51d91ae1ff38788f6b883d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 27 Sep 2007 13:13:07 +0000 Subject: [PATCH] Tidied up the new BackendPassesTest module, removing some old code that was not intended to be in there, and tidying up the imports list --- backends/BackendPassesTest.hs | 47 ++++------------------------------- 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/backends/BackendPassesTest.hs b/backends/BackendPassesTest.hs index 45a1f1a..1ed4e7a 100644 --- a/backends/BackendPassesTest.hs +++ b/backends/BackendPassesTest.hs @@ -20,51 +20,14 @@ with this program. If not, see . module BackendPassesTest (tests) where +import Control.Monad.State import Test.HUnit hiding (State) -import Control.Monad.State as CSM -import qualified Data.Map as Map + 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 - -skipP :: A.Structured -skipP = A.OnlyP m (A.Skip m) - -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 []) --} +import Pattern +import TestUtil +import TreeUtil -- | Test WaitUntil guard (should be unchanged) testTransformWaitFor0 :: Test