packages feed

spade-0.1.0.0: src/Test/Common.hs

module Test.Common
  ( module Test.Common
  , module Hedgehog
  , module Hedgehog.Gen
  , module Hedgehog.Range
  , module Test.Hspec
  ) where

import Hedgehog (Gen, Property, forAll, liftTest, property, (===))
import Hedgehog.Gen (bool, choice, element, enum, int, list, lower, maybe,
                     realFrac_, recursive, text, upper)
import Hedgehog.Range (linear, linearFrac)
import Test.Hspec (Spec, describe, it)
import Test.Hspec.Hedgehog

class HasGen a where
  getGen :: Gen a

instance HasGen a => HasGen [a] where
  getGen = list (linear 0 5) getGen

instance HasGen a => HasGen (Maybe a) where
  getGen = Hedgehog.Gen.maybe getGen