cardano-ledger-shelley-test-1.5.1.0: Test helpers from cardano-ledger-shelley exposed to other packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Shelley.Rewards

Description

Currently this uses the trace mechanism to check that computing rewards has a required set of properties. It works only in the Shelley Era. It could be generalized, and then moved to the GeneratorTrace directory which computes property tests in all eras.

Synopsis

Documentation

defaultMainTestTreeIO () Source #

Parse the command line arguments and run the tests.

When the tests finish, this function calls exitWith with the exit code that indicates whether any tests have failed. Most external systems (stack, cabal, travis-ci, jenkins etc.) rely on the exit code to detect whether the tests pass. If you want to do something else after defaultMain returns, you need to catch the exception and then re-throw it. Example:

import Test.Tasty
import Test.Tasty.HUnit
import System.Exit
import Control.Exception

test = testCase "Test 1" (2 @?= 3)

main = defaultMain test
  `catch` (\e -> do
    if e == ExitSuccess
      then putStrLn "Yea"
      else putStrLn "Nay"
    throwIO e)

Since: tasty-0.1

newEpochPropWord64 → (NewEpochState CProperty) → Property Source #

Provide a legitimate NewEpochState to make an test Property

newEpochEventsPropWord64 → ([ChainEvent C] → NewEpochState CProperty) → Property Source #

Given a NewEpochState and [ChainEvent], test a Property at every Epoch Boundary

Orphan instances

Terse (Reward c) Source # 
Instance details

Methods

terseReward c → String Source #

Terse x ⇒ Terse (Set x) Source # 
Instance details

Methods

terseSet x → String Source #