Update examples
This commit is contained in:
3
testsuite/makewith/module_name/Bar.hs
Normal file
3
testsuite/makewith/module_name/Bar.hs
Normal file
@ -0,0 +1,3 @@
|
||||
module Bar where
|
||||
|
||||
resource :: Int
|
4
testsuite/makewith/module_name/Foo.hs
Normal file
4
testsuite/makewith/module_name/Foo.hs
Normal file
@ -0,0 +1,4 @@
|
||||
module Foo where
|
||||
|
||||
resource :: Integer
|
||||
resource = 1
|
33
testsuite/makewith/module_name/Main.hs
Normal file
33
testsuite/makewith/module_name/Main.hs
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
import System.Plugins
|
||||
|
||||
import System.Directory
|
||||
|
||||
a = "Foo.hs" -- uesr code
|
||||
b = "Bar.hs" -- trusted code. Result is "Bar.o"
|
||||
|
||||
main = do
|
||||
status <- makeWith a b []
|
||||
s <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
status <- makeWith a b []
|
||||
s' <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
status <- makeWith a b []
|
||||
s'' <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess n s -> print n >> return s
|
||||
|
||||
print $ (s == s') && (s' == s'')
|
||||
|
||||
m_v <- load s [] [] "resource"
|
||||
v <- case m_v of
|
||||
LoadSuccess _ v -> return v
|
||||
_ -> error "load failed"
|
||||
putStrLn $ show $ (v :: Int)
|
||||
|
||||
makeCleaner s''
|
4
testsuite/makewith/module_name/Makefile
Normal file
4
testsuite/makewith/module_name/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
TEST=makewith/module_name
|
||||
|
||||
TOP=../../..
|
||||
include ../../eval.mk
|
5
testsuite/makewith/module_name/expected
Normal file
5
testsuite/makewith/module_name/expected
Normal file
@ -0,0 +1,5 @@
|
||||
ReComp
|
||||
NotReq
|
||||
NotReq
|
||||
True
|
||||
1
|
Reference in New Issue
Block a user