Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"number of examples" is misleading #3

Open
jwaldmann opened this issue Feb 20, 2017 · 3 comments
Open

"number of examples" is misleading #3

jwaldmann opened this issue Feb 20, 2017 · 3 comments

Comments

@jwaldmann
Copy link

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.

@sol
Copy link
Member

sol commented Feb 21, 2017

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?

@jwaldmann
Copy link
Author

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

@sol
Copy link
Member

sol commented Jan 14, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants