dimanche 12 mars 2017

Random tests generated by Haskell HSpec property

I am running tests with Hspec and Quickcheck http://hspec.github.io/

The provided example to execute a random test case is

it "returns the first element of an *arbitrary* list" $
      property $ \x xs -> head (x:xs) == (x :: Int)

With associated output:

returns the first element of an *arbitrary* list 

How can I see the actual run-time values generated for the test? So given above example, sample desired output would include values passed for x and xs with something like:

returns the first element of an *arbitrary* list 
    \x xy head (x:xs) == (x :: Int) with x = 'a' and xs = "bc" holds 




Aucun commentaire:

Enregistrer un commentaire