ouroboros-network-protocols:testlib
Safe HaskellNone
LanguageHaskell2010

Test.Ouroboros.Network.Testing.Utils

Synopsis

Documentation

splits2 :: ByteString -> [[ByteString]] Source #

Generate all 2-splits of a string.

splits3 :: ByteString -> [[ByteString]] Source #

Generate all 3-splits of a string.

prop_codec_cborM :: forall ps m. (Monad m, Eq (AnyMessage ps)) => Codec ps DeserialiseFailure m ByteString -> AnyMessageAndAgency ps -> m Bool Source #

Check that the codec produces a valid CBOR term that is decodeable by CBOR.decodeTerm.

prop_codec_valid_cbor_encoding :: Codec ps DeserialiseFailure IO ByteString -> AnyMessageAndAgency ps -> Property Source #

This property checks that the encoder is producing a valid CBOR. It encodes to ByteString using encode and decodes a FlatTerm from the bytestring which is the fed into validFlatTerm.