cardano-binary-1.9.1.0: Binary serialization for Cardano
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

arbitrary ∷ Gen U Source #

shrink ∷ U → [U] Source #

Show U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

showsPrec ∷ Int → U → ShowS #

show ∷ U → String #

showList ∷ [U] → ShowS #

FromCBOR U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

fromCBOR ∷ Decoder s U Source #

label ∷ Proxy U → Text Source #

ToCBOR U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

toCBOR ∷ U → Encoding Source #

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

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

Eq U Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

(==) ∷ U → U → Bool #

(/=) ∷ U → U → Bool #

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

showsPrec ∷ Int → U24 → ShowS #

show ∷ U24 → String #

showList ∷ [U24] → ShowS #

FromCBOR U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

ToCBOR U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

toCBOR ∷ U24 → Encoding Source #

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

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

Eq U24 Source # 
Instance details

Defined in Test.Cardano.Binary.Helpers

Methods

(==) ∷ U24 → U24 → Bool #

(/=) ∷ U24 → U24 → Bool #

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

cborFlatTermValid ∷ ToCBOR 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

cfg ∷ Buildable a ⇒ SizeTestConfig a Source #

Default configuration, for Buildable types.

scfg ∷ Show 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.