hspec / hspec-smallcheck

SmallCheck support for Hspec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"number of examples" is misleading

jwaldmann opened this issue · comments

When I use hspec-smallcheck like this,

main = hspecWith (defaultConfig { configSmallCheckDepth = 6 } ) $ do
  describe "toDoc should agree with show up to whitespace" $ do 
    it "Int" $ property $ prop ( Proxy :: Proxy Int )
    it "Foo" $ property $ prop ( Proxy :: Proxy Foo )
    it "Bar Foo" $ property $ prop ( Proxy :: Proxy (Bar Foo) )
    it "combined" $ property $ prop ( Proxy :: Proxy [(Bool, Maybe Foo)] )

it says

Finished in 1.6850 seconds
4 examples, 0 failures

Just 4 test cases? I was worried that the depth parameter was ignored.

But number 4 is the number of "it"s, right - and each contains a lot of test cases, so everything does work as intended.

Yes, exactly.

I you increase the depth (by e.g. passing --depth 100 as a command-line argument) you can verify that it takes depth into account.

Fine to close?

Your call. Keep this ticket open as "improve documentation"? I'll try to think of something, and send a PR, time permitting.

hspec-2.5.0 will allow informational output for successful tests. Once it's released we can change hspec-smallcheck to print the number of generated tests.