This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap-server".
The branch, master has been updated
via 44b1f5a40a9e3a0e65e5e27bb751c31b70d97bdc (commit)
from 30ed7eb20930923386be4d29d0b8560b3c13af54 (commit)
Summary of changes:
test/suite/Snap/Internal/Http/Parser/Tests.hs | 31 +++++++++++++-----------
1 files changed, 17 insertions(+), 14 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 44b1f5a40a9e3a0e65e5e27bb751c31b70d97bdc
Author: Gregory Collins <[email protected]>
Date: Tue May 25 01:34:14 2010 -0400
Fix testsuite
diff --git a/test/suite/Snap/Internal/Http/Parser/Tests.hs
b/test/suite/Snap/Internal/Http/Parser/Tests.hs
index 253ad8b..c287669 100644
--- a/test/suite/Snap/Internal/Http/Parser/Tests.hs
+++ b/test/suite/Snap/Internal/Http/Parser/Tests.hs
@@ -6,7 +6,7 @@ module Snap.Internal.Http.Parser.Tests
( tests ) where
import qualified Control.Exception as E
-import Control.Exception hiding (try)
+import Control.Exception hiding (try, assert)
import Control.Monad
import Control.Monad.Identity
import Control.Parallel.Strategies
@@ -19,6 +19,9 @@ import qualified Data.Map as Map
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2
+import Test.QuickCheck
+import qualified Test.QuickCheck.Monadic as QC
+import Test.QuickCheck.Monadic hiding (run, assert)
import Test.HUnit hiding (Test, path)
import Text.Printf
@@ -136,22 +139,22 @@ testChunked = testProperty "chunked transfer encoding"
prop_chunked
return $ liftM fromWrap i
testBothChunked :: Test
-testBothChunked = testProperty "chunk . unchunk == id" prop
+testBothChunked = testProperty "chunk . unchunk == id" $
+ monadicIO $ forAllM arbitrary prop
where
- prop :: L.ByteString -> Bool
- prop s = runIdentity (run iter) == s
- where
- bs = runIdentity $
- (writeChunkedTransferEncoding
- (enumLBS s) stream2stream) >>=
- run >>=
- return . fromWrap
+ prop s = do
+ bs <- QC.run $
+ writeChunkedTransferEncoding (enumLBS s) stream2stream
+ >>= run >>= return . fromWrap
- enum = enumLBS bs
+ let enum = enumLBS bs
- iter = runIdentity $ do
- i <- (readChunkedTransferEncoding stream2stream) >>= enum
- return $ liftM fromWrap i
+ iter <- do
+ i <- (readChunkedTransferEncoding stream2stream) >>= enum
+ return $ liftM fromWrap i
+
+ x <- run iter
+ QC.assert $ s == x
-----------------------------------------------------------------------
hooks/post-receive
--
snap-server
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap