Update examples
This commit is contained in:
18
testsuite/dynload/should_fail_3/prog/Main.hs
Normal file
18
testsuite/dynload/should_fail_3/prog/Main.hs
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
import System.Plugins
|
||||
import API
|
||||
|
||||
conf = "../Plugin.in"
|
||||
stub = "../Plugin.stub"
|
||||
|
||||
main = do
|
||||
status <- makeWith conf stub ["-i../api", "-i../../../../src/altdata"]
|
||||
o <- case status of
|
||||
MakeFailure e -> mapM_ putStrLn e >> error "failed"
|
||||
MakeSuccess _ o -> return o
|
||||
m_v <- dynload o ["../api"] [] "resource_dyn"
|
||||
case m_v of
|
||||
LoadFailure _ -> error "didn't compile"
|
||||
LoadSuccess _ v -> do putStrLn $ (function v)
|
||||
makeCleaner o
|
||||
|
9
testsuite/dynload/should_fail_3/prog/expected
Normal file
9
testsuite/dynload/should_fail_3/prog/expected
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
../Plugin.in:18:
|
||||
Couldn't match `Dynamic' against `(t, t1)'
|
||||
Expected type: Dynamic
|
||||
Inferred type: (t, t1)
|
||||
In the definition of `resource_dyn':
|
||||
resource_dyn = (typeOf plugin, unsafeCoerce v)
|
||||
|
||||
Fail: failed
|
8
testsuite/dynload/should_fail_3/prog/expected.604
Normal file
8
testsuite/dynload/should_fail_3/prog/expected.604
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
../Plugin.in:18:15:
|
||||
Couldn't match `Dynamic' against `(a, b)'
|
||||
Expected type: Dynamic
|
||||
Inferred type: (a, b)
|
||||
In the definition of `resource_dyn':
|
||||
resource_dyn = (typeOf plugin, unsafeCoerce v)
|
||||
a.out: failed
|
8
testsuite/dynload/should_fail_3/prog/expected.605
Normal file
8
testsuite/dynload/should_fail_3/prog/expected.605
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
../Plugin.in:18:15:
|
||||
Couldn't match `Dynamic' against `(a, b)'
|
||||
Expected type: Dynamic
|
||||
Inferred type: (a, b)
|
||||
In the definition of `resource_dyn':
|
||||
resource_dyn = (typeOf plugin, unsafeCoerce v)
|
||||
a.out: failed
|
Reference in New Issue
Block a user