ouroboros-consensus-0.18.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Util.Range

Synopsis

Documentation

data Range n Source #

Constructors

R_Eq n 
R_Btwn (n, n) 
R_Gt n 

Instances

Instances details
Show n ⇒ Show (Range n) Source # 
Instance details

Defined in Test.Util.Range

Methods

showsPrecIntRange n → ShowS #

showRange n → String #

showList ∷ [Range n] → ShowS #

Eq n ⇒ Eq (Range n) Source # 
Instance details

Defined in Test.Util.Range

Methods

(==)Range n → Range n → Bool #

(/=)Range n → Range n → Bool #

data RangeK Source #

Rough indication of the size of a value in relation to k

Useful for labelling tests.

Constructors

Range_Eq_K SecurityParam

The value was equal to K

Range_Just_Below_K SecurityParam Word64

The value was just below to K

We indicate how far off from K it was

Range_Just_Above_K SecurityParam Word64

The value was just above K

We indicate how far off from K it was

Range_Near_Zero SecurityParam Word64

The value was almost zero

If there is a choice between Range_Just_Below_K and Range_Near_Zero, the constructor with the smaller argument should be used.

Range_Less_Than_K SecurityParam Word64

Less than k (but not near k and not near 0)

We round to the neareast multiple of (k / 10)

Range_More_Than_K SecurityParam Word64

More than k (but not near k)

We round to the first power of two above k that is equal to above the value.

Instances

Instances details
Show RangeK Source # 
Instance details

Defined in Test.Util.Range

Methods

showsPrecIntRangeKShowS #

showRangeKString #

showList ∷ [RangeK] → ShowS #

Eq RangeK Source # 
Instance details

Defined in Test.Util.Range

Methods

(==)RangeKRangeKBool #

(/=)RangeKRangeKBool #

range ∷ (Ord n, Show n, Num n) ⇒ n → Range n Source #