mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 20:45:52 +00:00
* package and module docs, remove Simplex.Markdown (moved to simplex-chat), rename Agent.Transmission to Agent.Protocol * move errors.md to haddock comments, Transport docs * add CHANGELOG.md, add missing package versions * changelog, copyright * docs for Simplex.Messaging.Crypto * consistent punctuation * use absolute URLs in readme * correction
19 lines
778 B
Haskell
19 lines
778 B
Haskell
module ProtocolErrorTests where
|
|
|
|
import Simplex.Messaging.Agent.Protocol (AgentErrorType, agentErrorTypeP, serializeAgentError)
|
|
import Simplex.Messaging.Parsers (parseAll)
|
|
import Simplex.Messaging.Protocol (ErrorType, errorTypeP, serializeErrorType)
|
|
import Test.Hspec
|
|
import Test.Hspec.QuickCheck (modifyMaxSuccess)
|
|
import Test.QuickCheck
|
|
|
|
protocolErrorTests :: Spec
|
|
protocolErrorTests = modifyMaxSuccess (const 1000) $ do
|
|
describe "errors parsing / serializing" $ do
|
|
it "should parse SMP protocol errors" . property $ \err ->
|
|
parseAll errorTypeP (serializeErrorType err)
|
|
== Right (err :: ErrorType)
|
|
it "should parse SMP agent errors" . property $ \err ->
|
|
parseAll agentErrorTypeP (serializeAgentError err)
|
|
== Right (err :: AgentErrorType)
|