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

Property Module: PropTestConfig's iterations parameter is not respected. #2428

Closed
nicorichard opened this issue Aug 23, 2021 · 1 comment · Fixed by #2429
Closed

Property Module: PropTestConfig's iterations parameter is not respected. #2428

nicorichard opened this issue Aug 23, 2021 · 1 comment · Fixed by #2429
Milestone

Comments

@nicorichard
Copy link
Contributor

Which version of Kotest are you using

4.6.1

Description

The PropTest/PropTestConfig data structures described here contain a value iterations which is not respected by checkAll, forAll, or the underlying internal proptest functions.

Steps to Reproduce

Test code:

@Test
fun test_checkAll_iterations() = runBlockingTest {
    val expectedIterations = 10
    
    var iterationCounter = 0
    checkAll(PropTestConfig(iterations = expectedIterations), Arb.int()) {
        iterationCounter++
    }
    
    assertEquals(expectedIterations, iterationCounter)
}

Result:

expected:<10> but was:<1000>
sksamuel pushed a commit that referenced this issue Aug 24, 2021
* Fix for PropTestConfig iterations

* improve tests

* Improve proptest function API to be more clear about the iteration variable (contained in the config)

Co-authored-by: Nico Richard <nicolas.richard@skipthedishes.ca>
@sksamuel sksamuel added this to the 4.6.2 milestone Aug 24, 2021
sksamuel pushed a commit that referenced this issue Aug 24, 2021
* Fix for PropTestConfig iterations

* improve tests

* Improve proptest function API to be more clear about the iteration variable (contained in the config)

Co-authored-by: Nico Richard <nicolas.richard@skipthedishes.ca>
@sksamuel
Copy link
Member

Released in 4.6.2

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 a pull request may close this issue.

2 participants