Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- goldenTestCBOR ∷ ∀ a. (FromCBOR a, ToCBOR a, Eq a, Show a, HasCallStack) ⇒ a → FilePath → Property
- goldenTestCBORExplicit ∷ ∀ a. (Eq a, Show a, HasCallStack) ⇒ Text → (a → Encoding) → (∀ s. Decoder s a) → a → FilePath → Property
- goldenTestExplicit ∷ ∀ a. (Eq a, Show a, HasCallStack) ⇒ (a → ByteString) → (ByteString → Either DecoderError a) → a → FilePath → Property
- roundTripsCBORShow ∷ (FromCBOR a, ToCBOR a, Eq a, MonadTest m, Show a, HasCallStack) ⇒ a → m ()
- roundTripsCBORBuildable ∷ (FromCBOR a, ToCBOR a, Eq a, MonadTest m, Buildable a, HasCallStack) ⇒ a → m ()
- compareHexDump ∷ (MonadTest m, HasCallStack) ⇒ HexDump → HexDump → m ()
- deprecatedGoldenDecode ∷ HasCallStack ⇒ Text → (∀ s. Decoder s ()) → FilePath → Property
Documentation
goldenTestCBOR ∷ ∀ a. (FromCBOR a, ToCBOR a, Eq a, Show a, HasCallStack) ⇒ a → FilePath → Property Source #
Check that the encode
and decode
function of the Bi
instances work as
expected w.r.t. the give reference data, this is, given a value x::a
, and
a file path fp
:
- The encoded data should coincide with the contents of the
fp
. - Decoding
fp
should give as a resultx
goldenTestCBORExplicit Source #
∷ ∀ a. (Eq a, Show a, HasCallStack) | |
⇒ Text | Label for error reporting when decoding. |
→ (a → Encoding) | |
→ (∀ s. Decoder s a) | |
→ a | |
→ FilePath | |
→ Property |
Variant of goldenTestBi
using custom encode and decode functions.
This is required for the encode/decode golden-tests for types that do no
have a Bi
instance.
goldenTestExplicit ∷ ∀ a. (Eq a, Show a, HasCallStack) ⇒ (a → ByteString) → (ByteString → Either DecoderError a) → a → FilePath → Property Source #
roundTripsCBORShow ∷ (FromCBOR a, ToCBOR a, Eq a, MonadTest m, Show a, HasCallStack) ⇒ a → m () Source #
roundTripsCBORBuildable ∷ (FromCBOR a, ToCBOR a, Eq a, MonadTest m, Buildable a, HasCallStack) ⇒ a → m () Source #
compareHexDump ∷ (MonadTest m, HasCallStack) ⇒ HexDump → HexDump → m () Source #
A custom version of (===)
for HexDump
s to get prettier diffs
deprecatedGoldenDecode ∷ HasCallStack ⇒ Text → (∀ s. Decoder s ()) → FilePath → Property Source #