morley-1.4.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Michelson.Test.Gen

Description

Utilities for arbitrary data generation in property tests.

Deprecation Notice

At the moment, this module exposes both Hedgehog generators and QuickCheck Arbitrary instances for convenience. However, Arbitrary instances should be considered deprecated and will eventually be removed.

Synopsis

Documentation

minTimestamp :: Timestamp Source #

Minimal (earliest) timestamp used for Arbitrary (CValue 'CTimestamp)

maxTimestamp :: Timestamp Source #

Maximal (latest) timestamp used for Arbitrary (CValue 'CTimestamp)

midTimestamp :: Timestamp Source #

Median of minTimestamp and maxTimestamp. Useful for testing (exactly half of generated dates will be before and after this date).

genValueInt :: MonadGen m => m (Value' instr 'TInt) Source #

genValueList :: (MonadGen m, KnownT a) => m (Value' instr a) -> m (Value' instr ('TList a)) Source #

genValuePair :: MonadGen m => m (Value' instr a) -> m (Value' instr b) -> m (Value' instr ('TPair a b)) Source #

Orphan instances

Arbitrary Timestamp Source # 
Instance details

Arbitrary Mutez Source # 
Instance details

Methods

arbitrary :: Gen Mutez #

shrink :: Mutez -> [Mutez] #

Arbitrary (Value' instr 'TTimestamp) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr 'TTimestamp) #

shrink :: Value' instr 'TTimestamp -> [Value' instr 'TTimestamp] #

(Arbitrary (Value' instr a), Arbitrary (Value' instr b)) => Arbitrary (Value' instr ('TPair a b)) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr ('TPair a b)) #

shrink :: Value' instr ('TPair a b) -> [Value' instr ('TPair a b)] #

Arbitrary (Value' instr 'TUnit) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr 'TUnit) #

shrink :: Value' instr 'TUnit -> [Value' instr 'TUnit] #

(KnownT a, Arbitrary (Value' instr a)) => Arbitrary (Value' instr ('TList a)) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr ('TList a)) #

shrink :: Value' instr ('TList a) -> [Value' instr ('TList a)] #

Arbitrary (Value' instr 'TInt) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr 'TInt) #

shrink :: Value' instr 'TInt -> [Value' instr 'TInt] #

Arbitrary (Value' instr 'TMutez) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr 'TMutez) #

shrink :: Value' instr 'TMutez -> [Value' instr 'TMutez] #

Arbitrary (Value' instr 'TKeyHash) Source # 
Instance details

Methods

arbitrary :: Gen (Value' instr 'TKeyHash) #

shrink :: Value' instr 'TKeyHash -> [Value' instr 'TKeyHash] #