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 => Codec ps DeserialiseFailure m ByteString -> AnyMessage 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 -> AnyMessage 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.

prop_codec_st_cborM :: forall ps (f :: ps -> Type) m. Monad m => Codec ps DeserialiseFailure f m ByteString -> AnyMessage ps f -> m Bool Source #

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

prop_codec_st_valid_cbor_encoding :: forall ps (f :: ps -> Type). Codec ps DeserialiseFailure f IO ByteString -> AnyMessage ps f -> 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.