From a888d1eb750d9df5738dabfb29337d249f2cd230 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Sat, 5 May 2007 19:54:15 +0200 Subject: make quickcheck tests friendlier to read. darcs-hash:20070505175415-72aca-2129b8432f6f2ddb9d1498b0503b86c401020194 --- tests/Properties.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/Properties.hs b/tests/Properties.hs index b4e90a6..4707305 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -16,6 +16,7 @@ import System.IO import System.Random import Text.Printf import Data.List (nub,sort,group,sort,intersperse,genericLength) +import Data.Char (ord) import Data.Map (keys,elems) import qualified Data.Map as M @@ -121,7 +122,7 @@ prop_notpeek_peekStack n x = current x /= n && isJust (peek x) ==> peekStack n x ------------------------------------------------------------------------ -type T = StackSet Int Int Int +type T = StackSet Int Int Char prop_delete_uniq i x = not (member i x) ==> delete i x == x where _ = x :: T @@ -249,6 +250,10 @@ noOverlaps xs = and [ verts a `notOverlap` verts b ------------------------------------------------------------------------ +instance Arbitrary Char where + arbitrary = choose ('a','z') + coarbitrary n = coarbitrary (ord n) + instance Random Word8 where randomR = integralRandomR random = randomR (minBound,maxBound) -- cgit v1.2.3