Ad
  • Custom User Avatar

    Yeah, I'm not taking your request as a pain, nor am I trying to be one. The nature of the random testing framework is a little weird, because it is abstracting away the isses with randomness not being deterministic and therefore needing to be handled in a monad. Because of this I have no control over what it reports when it performs the random testing. If the random testing succeeds then you see that you passed the tests with the output specified by the spec. If it doesn't you get a single instance describing the one case where the property you described was falsefied.

    To be honest, there might be a way to control this directly but I've never seen it done. Admittedly I don't inspect every test written for every library I use, so maybe it's in there somewhere. But I can safely say, in regards to katas, I've never seen testing output like this in a haskell implementation.

    Hopefully this, more specific description, is less vague and possibly makes more sense. I'm happy to discuss further. Thanks!

  • Custom User Avatar

    Hi dinglemouse. Outputting the random input/expected is pretty anti-haskell. In fact, to do it I'd have to jump through a bunch of hoops who's location I'm not quite sure exist. This has to do with the fact that haskell has a random testing library that the unittesting library knows how to interact with. To do with you're describing I think I'd have to implement some of my own from scratch, or go deep into the internals of the random testing library, which isn't going to happen.

    This is a side-effect of haskell being a purely functional language, which in a random testing context means, I'm very happy a random testing framework already exits because I'd otherwise have to deal with a bunch of nested monads.

    If, after this description, the solution still feels insufficient, I apologize and hope someone else picks up this kumite and finishes it to your satisfaction. :)

  • Custom User Avatar
  • Custom User Avatar

    Never tried to use quickcheck quite like that. I don't know if it's a idiomatic usage, but it's testing for random floats in the range [-100, 100] now.