| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Consensus.Genesis.TestSuite.SmallKey.Tests
Documentation
Unit tests for the correct derivation of some simple ADT SmallKey
instances and a test asserting failure for each black-listing strategy:
- A type with a product on its generic representation.
- A type with a explicitly black-listed field.
NOTE: These tests depend on -fdefer-type-errors to run.
TODO: Once the use of TypeError is replaced with Unsatisfiable in
SmallKey it should be possible to assertError the actual type error
instead of the unreacheable runtime error from getAllKeys, and write a
test case for the forbidden directly recursive types, e.g.
data DirectlyRecursive = Nil | More DirectlyRecursive deriving stock (Eq, Ord, Generic) deriving SmallKey via Generically DirectlyRecursive
for which the corresponding test would not terminate trying to evaluate
getAllKeys otherwise.
See TODO [BlackList].