[QuickCheck] uncaught exception: SomeAsyncException (stack overflow) (after 3 tests and 3 shrinks)

Boris Rozinov borisrozinov at yahoo.ca
Sat Apr 16 17:02:42 BST 2016


multBy:: (Eq a, Integral a) => a -> a -> a
multBy 0 _ = 0
multBy 1 n = n
multBy m n = n+ multBy (m-1) n

multByI::Integer->Integer->Integer 
multByI i1 i2= i1*i2

--works fine:
       it "x*y(i)  is always eq to y*x" $ do
            property $ (\x y -> (multByI x y) == (multByI y x::Integer) )


--but this one gives error:
        it "x*y  is always eq to y*x" $ do
            property $ (\x y -> (multBy (x::Integer) (y::Integer)) == (multBy (y::Integer) (x::Integer)) )


  Addition.hs:32:
  1) Addition x*y  is always eq to y*x
       uncaught exception: SomeAsyncException (stack overflow) (after 3 tests and 3 shrinks)
       0
       -1

Randomized with seed 1748887214

Finished in 92.4021 seconds
12 examples, 1 failure
*** Exception: ExitFailure 1

Thanks, Boris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/quickcheck/attachments/20160416/490d778b/attachment.htm>


More information about the QuickCheck mailing list