0

I'm using Hedgehog with tasty-discover and have written a simple class that implements Square 2D coordinates/vectors. I've then written the following test. Only problem is, it only seems to run one test, which runs extremely quickly, leading me to believe there's a problem here.

How do I get it to run the test 10000 times?

module Spec where

import Test.Tasty
import Hedgehog             
import Hedgehog.Checkers
import qualified Hedgehog.Gen          as Gen
import qualified Hedgehog.Range        as Range
import Lib

make2D :: a -> a -> Point2D a
make2D x y = Point2D { _x = x, _y = y }

point2DGen :: (Gen a) -> Gen (Point2D a)
point2DGen g = make2D <$> g <*> g

small2DGen :: Gen (Point2D Int)
small2DGen = point2DGen . Gen.integral $ Range.linearFrom (0 :: Int) (0-10) 10

hprop_SquareMonoid :: Property
hprop_SquareMonoid = withTests 1000000000 . property . monoid $ Square <$> small2DGen
Julian Birch
  • 2,605
  • 1
  • 21
  • 36
  • 1
    I don't know why this is happening but I'm trying to understand it. First off, I used a simple property with a print statement to find out exactly how many tests are executed. It seems that irrespective of the value passed to `withTests`, tasty-discover is running 100 tests but reporting it as just one short test. To understand the phenomenon further, I have decided to examine the testing code generated by passing the `--debug` option in the driver file. That's as far as I am right now. – Kartik Sabharwal Jun 01 '18 at 04:54
  • I think "It's broken" qualifies as an answer. I've also posted an issue to guthub. https://github.com/lwm/tasty-discover/issues/153 – Julian Birch Jun 01 '18 at 21:12

0 Answers0