Skip to content

Commit

Permalink
Removed QuickCheck dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Feb 11, 2019
1 parent 402b14f commit de15a7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions typed-protocols/src/Network/TypedProtocol/Codec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ import qualified Data.ByteString.Lazy as LBS

import Data.Proxy (Proxy)

import Test.QuickCheck (Property, property)


-- | A codec for a 'Protocol' handles the encoding and decoding of typed
-- protocol messages. This is typically used when sending protocol messages
Expand Down Expand Up @@ -290,10 +288,10 @@ prop_codec
-> (forall (pk :: PeerKind). Codec ps pk failure m bytes)
-- ^ codec
-> AnyMessage ps
-> Property
-> Bool
prop_codec otherPeer chunks runM codec (AnyMessage tok msg) =
let bytes :: [bytes]
bytes = chunks $ encode codec tok msg
in case runM $ runDecode (otherPeer tok) (double tok) bytes codec of
Right (SomeMessage msg') -> property $ (AnyMessage tok msg') == (AnyMessage tok msg)
Left _ -> property False
Right (SomeMessage msg') -> (AnyMessage tok msg') == (AnyMessage tok msg)
Left _ -> False
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ instance Show AnyPingPongMessage where

prop_codecPingPong
:: AnyPingPongMessage
-> Property
-> Bool
prop_codecPingPong (AnyPingPongMessage tok msg) =
prop_codec otherPeer (map (\b -> [b])) runIdentity codecPingPong (AnyMessage tok msg)
where
Expand Down
3 changes: 1 addition & 2 deletions typed-protocols/typed-protocols.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ library
-- TODO: do we want these here or move elsewhere?
bytestring,
process,
cborg,
QuickCheck
cborg

hs-source-dirs: src
default-language: Haskell2010
Expand Down

0 comments on commit de15a7a

Please sign in to comment.