https://kotlinlang.org logo
#kotest
Title
# kotest
j

James Eschner

01/12/2022, 10:05 PM
One thing I noticed while creating an
Arb
automagically using
Arb.bind
is that I’m not getting any null support. For example, if I have the following data class:
Copy code
data class Foo(
  val myInt: Int?
)
and I generate an arb like so:
Copy code
val fooArb = Arb.bind<Foo>()
I have never encountered a generated value with
myInt == null
. Is this expected? Is there a way to get this behavior? * Not a contribution*
s

sam

01/12/2022, 10:22 PM
I guess we didn't think of that when we did it 🙂
The auto generator could detect for null and add nulls in
🤩 2
j

James Eschner

01/12/2022, 10:24 PM
If it did, that would be awesome 🙏🏻. Nulls tend to cause the majority of my headaches these days, or who am I kidding, most days 🙃
😂 1
s

sam

01/13/2022, 2:07 AM
j

James Eschner

01/13/2022, 2:19 PM
Sam! Thank you! Wow that’s great, can’t wait to try it out when it is released.
4 Views