What's the recommendation when wanting to use `che...
# kotest
j
What's the recommendation when wanting to use
checkAll
, or something like it, but when more than 12 values need to be generated at once?
s
Make a PR to add 13, 14, etc 😛
e
You could bind several values into a fixture class.. like:
Copy code
data class Fixture(a: Int, b: String // etc)

checkAll(Arb.bind<Fixture>(), [other arbs]) { (a, b), [ other values] -> 
 }
j
Make a PR to add 13, 14, etc 😛
If it won't be rejected on principle alone, I will. Just wouldn't want to do a bunch of work that's rejected for reasons other than implementation choices.
s
It wouldn't be rejected if you just copy n paste the 12 arity one and make a 13 arity one, etc
j
That's exactly what I had in mind...
I want to go up to 22. You game?
Btw, I'm interested in this because we have 22-arity functions in Arrow, which I need to write tests for.
s
yes lets do it
all the way to 22
j
Right on!
@Sam I don't see an existing issue, so I'm going to create one.
s
ok
I'll be releasing 5.5.5 tomorrow so we can include this if it's ready in time
j
Bummer. It's going to be at least a few days before I have this. But thanks for the heads up.
s
Ok well 5.6 will be released shortly after, as a Kotlin 1.8 release
j
Awesome! 🚀
a
I notice quite a bit of lag in IntelliJ when the autocomplete for
checkAll()
is loading, which I suspect is related to the large amount of overloads that have lots of generics. Can you make sure that the performance is okay when you try increasing it please?
e
Great point adam.. I have had issues with that too 😬
s
I wonder if we could reduce the number of overloads, there's loads that have config/not config etc
j
Can you make sure that the performance is okay when you try increasing it please?
@Adam S Do you have suggestions how to do this? What's the standard to compare to? @sam Could this be a limit on going to 22-arity?
s
We do have a billion overloads, so I would only add more for the ones in this format:
Copy code
suspend fun <A, B> forAll(
   config: PropTestConfig = PropTestConfig(),
   genA: Gen<A>,
   genB: Gen<B>,
   property: suspend PropertyContext.(A, B) -> Boolean
)
And not these ones:
Copy code
suspend fun <A, B> forAll(
   iterations: Int,
   genA: Gen<A>,
   genB: Gen<B>,
   property: suspend PropertyContext.(A, B) -> Boolean
)
And not the ones that infer the types,
Copy code
suspend inline fun <reified A, reified B> forAll(
   crossinline property: PropertyContext.(A, B) -> Boolean
)
If you want to use 20 arbs that's fine, but you can specify them. I think that's a fair tradeoff.
j
Okay, will do @sam. What about the `checkAll`s and `forNone`s? Same pattern for which overloads to not include?
s
yeah
j
And ignore these too?
Copy code
suspend inline fun <reified A, reified B, reified C, reified D, reified E, reified F, reified G, reified H, reified I, reified J, reified K, reified L, reified M> checkAll(
   noinline property: suspend PropertyContext.(A, B, C, D, E, F, G, H, I, J, K, L, M) -> Unit
)
I have a draft PR. Please let me know if all looks good, so I can replicate to remaining arities. Thanks!
s
Yep looks good
j
Cool. Thanks!
@sam Regarding tests for the code I'm adding, I've found
CheckAllExhaustivesIterationTest
,
PropTestConfigConstraintsTest
, and
ForAllExhaustivesIterationTest
, that I need to add tests to. Any others you know of? Thanks!
s
That should be sufficent.