Commit 168c6b2a authored by Ian Lynagh's avatar Ian Lynagh

Add testcase from trac #1171 as cg059

parent bbdacb83
......@@ -60,3 +60,4 @@ test('cg057', composes([expect_broken(948),
compile_and_run, [''])
test('cg058', normal, compile_and_run, [''])
test('cg059', exit_code(1), compile_and_run, [''])
-- GHC 6.6 compiled YHC wrong; this is a cutdown testcase (from trac #1171).
module Main where
import Directory
data Error
= ErrorFileNone
| ErrorFileMany
FilePath -- file you were looking for
raiseError ErrorFileNone = error "Error: File not found"
raiseError (ErrorFileMany file) = error $ "Error: Found file multiple times: "++file
data PackageData = PackageData [FilePath] deriving Show
getModule :: PackageData -> String -> IO ()
getModule (PackageData rs@(root:rest)) file =
do local <- testPackage root
res <- testPackage root
print (local, res)
case (local,res) of
([x], _) -> return ()
(_, [x]) -> return ()
([], []) -> raiseError $ ErrorFileNone
(as, bs) -> if as++bs == [] then error "Empty as++bs" else raiseError $ ErrorFileMany file
where
testPackage pkg =
do
bHi <- doesFileExist ""
return [("","") | bHi]
main = getModule (PackageData ["7"]) "13"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment