Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

nonFlaky is a commonly used test aspect. Currently the user has to specify the number of times for the test to be repeated. This PR adds an overloaded version that repeats a test a default number of times determined by the test framework (currently set at 100). I think this makes it a little nicer. Users can still specify a number of repetitions if they want.

@adamgfraser adamgfraser requested a review from jdegoes November 3, 2019 20:24
@jdegoes jdegoes merged commit fc44d80 into zio:master Nov 4, 2019
@adamgfraser adamgfraser deleted the nonflaky branch November 4, 2019 04:09
Comment on lines +346 to +347
val nonFlaky: TestAspectPoly =
nonFlaky(100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I don't appreciate this change, far from it, but why didn't you use default arguments, of course, in the original function declaration, like so:

def nonFlaky(n0: Int = 100): TestAspectPoly = ???

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do that then you would need to call the method as nonFlaky() instead of nonFlaky. That is somewhat irregular (no other test aspect is called that way and it gives the impression that it is possibly an impure method) so I think it is nicer to do it this way, especially when it is only a few extra lines of code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you answered my question 😄

ghostdogpr pushed a commit to ghostdogpr/scalaz-zio that referenced this pull request Nov 5, 2019
Twizty pushed a commit to Twizty/zio that referenced this pull request Nov 13, 2019
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

Successfully merging this pull request may close these issues.

4 participants