1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00
semantic/test/Generators.hs
Patrick Thomson e1d94f07d1 Remove Listable instance for Source.
This was created with a whole mess of Leancheck combinators. A
Hedgehog approach makes things easier.
2019-06-14 11:53:42 -04:00

13 lines
332 B
Haskell

{-# LANGUAGE TypeFamilies #-}
module Generators
( source
) where
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Data.Source
import Data.Functor.Identity
source :: (GenBase m ~ Identity, MonadGen m) => Hedgehog.Range Int -> m Data.Source.Source
source r = Data.Source.fromUTF8 <$> Gen.utf8 r Gen.unicode