cardano-binary-test-1.4.0.2: Test helpers from cardano-binary exposed to other packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Binary.Helpers

Synopsis

Binary test helpers

data U Source #

Instances

Instances details
Arbitrary U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

arbitraryGen U Source #

shrinkU → [U] Source #

Show U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

showsPrecIntUShowS Source #

showUString Source #

showList ∷ [U] → ShowS Source #

FromCBOR U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

fromCBORDecoder s U Source #

labelProxy UText Source #

ToCBOR U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

toCBORUEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy USize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [U] → Size Source #

Eq U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

(==)UUBool Source #

(/=)UUBool Source #

data U24 Source #

Like U, but we expect to read back the Cbor Data Item when decoding.

Instances

Instances details
Show U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

showsPrecIntU24ShowS Source #

showU24String Source #

showList ∷ [U24] → ShowS Source #

FromCBOR U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

ToCBOR U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

toCBORU24Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy U24Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [U24] → Size Source #

Eq U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

(==)U24U24Bool Source #

(/=)U24U24Bool Source #

extensionProperty ∷ ∀ a. (Arbitrary a, Eq a, Show a, FromCBOR a, ToCBOR a) ⇒ Property Source #

Given a data type which can be extended, verify we can indeed do so without breaking anything. This should work with every time which adopted the schema of having at least one constructor of the form: .... | Unknown Word8 ByteString

cborFlatTermValidToCBOR a ⇒ a → Property Source #

Machinery to test we perform "flat" encoding.

Static size estimates

data SizeTestConfig a Source #

Configuration for a single test case.

Constructors

SizeTestConfig 

Fields

cfgBuildable a ⇒ SizeTestConfig a Source #

Default configuration, for Buildable types.

scfgShow a ⇒ SizeTestConfig a Source #

Default configuration, for Showable types.

sizeTest ∷ ∀ a. ToCBOR a ⇒ SizeTestConfig a → Property Source #

Create a test case from the given test configuration.