File: GShrinkExample.hs

package info (click to toggle)
haskell-quickcheck 2.14.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 432 kB
  • sloc: haskell: 5,104; sh: 32; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE DeriveGeneric, ScopedTypeVariables, TemplateHaskell #-}

module Main where

import GHC.Generics (Generic)
import Test.QuickCheck

data Nat = Z | S Nat deriving (Eq, Show, Generic)


instance Arbitrary Nat where arbitrary = error "not implemented"

prop_shrink =
  genericShrink (S (S Z)) === [S Z] .&&.
  genericShrink [0::Int] === [[]]

return []

main :: IO ()
main = do True <- $quickCheckAll; return ()