Update examples
This commit is contained in:
4
testsuite/makewith/multi_make/Bar.hs
Normal file
4
testsuite/makewith/multi_make/Bar.hs
Normal file
@ -0,0 +1,4 @@
|
||||
module Bar where
|
||||
|
||||
resource :: Int
|
||||
resource = 2
|
4
testsuite/makewith/multi_make/Foo.hs
Normal file
4
testsuite/makewith/multi_make/Foo.hs
Normal file
@ -0,0 +1,4 @@
|
||||
module Foo where
|
||||
|
||||
resource :: Integer
|
||||
resource = 1
|
37
testsuite/makewith/multi_make/Main.hs
Normal file
37
testsuite/makewith/multi_make/Main.hs
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
import System.Plugins
|
||||
|
||||
import System.Directory
|
||||
|
||||
a = "Foo.hs" -- user code
|
||||
b = "Bar.hs" -- more user code
|
||||
z = "Stub.hs" -- and a stub
|
||||
|
||||
main = do
|
||||
status <- makeWith a z []
|
||||
s <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
status <- makeWith b z []
|
||||
s' <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
-- shouldn't need to remerge (a,z)
|
||||
status <- makeWith a z []
|
||||
t <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
-- shouldn't need to remerge (b,z)
|
||||
status <- makeWith b z []
|
||||
t' <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
print $ s /= s' -- test we got unique modules
|
||||
print $ t /= t' -- test we got unique modules
|
||||
|
||||
mapM_ makeCleaner [s,s']
|
||||
|
4
testsuite/makewith/multi_make/Makefile
Normal file
4
testsuite/makewith/multi_make/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
TEST=makewith/multi_make
|
||||
|
||||
TOP=../../..
|
||||
include ../../eval.mk
|
4
testsuite/makewith/multi_make/Stub.hs
Normal file
4
testsuite/makewith/multi_make/Stub.hs
Normal file
@ -0,0 +1,4 @@
|
||||
module Stub where
|
||||
|
||||
resource :: Int
|
||||
|
6
testsuite/makewith/multi_make/expected
Normal file
6
testsuite/makewith/multi_make/expected
Normal file
@ -0,0 +1,6 @@
|
||||
ReComp
|
||||
ReComp
|
||||
NotReq
|
||||
NotReq
|
||||
True
|
||||
True
|
Reference in New Issue
Block a user