Hi :wave: If I’ve got a String Arb and I set the ...
# kotest
a
Hi 👋 If I’ve got a String Arb and I set the minimum size to 1, how can I stop it shrinking to size 0? In this example,
authKey
shrinks to 0, and so gives an invalid reason for failure.
Copy code
test("expect 'actual code is failing', _not_ authKey length error") {
    checkAll(
      Arb.string(1..10, Arb.alphanumeric()),
    ) {
        authKey,
      ->
      withClue("authKey must have length > 0") {
        authKey shouldHaveMinLength 1
      }
      fail("actual code is failing")
    }
  }
I’ve tried using
Arb.string(1..10, Arb.alphanumeric()).filter { it.isEmpty() },
but then the test loops endlessly
s
the shrinker doesn't take into account sizes
Can you file a bug on github and we'll push out a fix
👌 1
a