[HUnit-users] monadic HUnit testing
Status: Beta
Brought to you by:
dherington
|
From: Shae M. E. <sh...@Sc...> - 2004-03-01 12:11:13
|
in short:
assertEqualM doc resp action =
do result <- action
return $ assertEqual doc resp result
myTestList
= liftM TestList $ mapM (liftM TestCase)
[
assertEqualM "hello xmlrpc" "Hello Haskell"
((remote "http://shapr.homelinux.net:9673/" "pyhello" "Haskell") :: IO [Char])
]
h = join $ liftM runTestTT myTestList
main = do c <- h
putStr $ show c
let errs = errors c
fails = failures c
System.exitWith (codeGet errs fails)
codeGet errs fails
| fails > 0 = ExitFailure 2
| errs > 0 = ExitFailure 1
| otherwise = ExitSuccess
anyways, I have more demo code along these lines if someone is interested.
--
Shae Erisson - putStr $ fix("HELLO\n"++) - http://www.ScannedInAvian.org/
OSDir: Community building... interesting... what's the secret sauce?
Limi: Irresponsible sleep patterns.
-- Alexander Limi, one of the Plone founders http://osdir.com/Article199.phtml
|