Is there a way to get more descriptive error messa...
# kotlintest
s
Is there a way to get more descriptive error messages in KotlinTest when using property based testing?
Copy code
Property failed for
Arg 0: Tuple3(a=1892782087, b=-1623939597, c=833942858)
after 1 attempts
Caused by: expected: true but was: false
java.lang.AssertionError: Property failed for
Arg 0: Tuple3(a=1892782087, b=-1623939597, c=833942858)
after 1 attempts
Caused by: expected: true but was: false
s
What would you like to see added
s
I’m comparing 2 tuples at the end of my Arrow Fx tests here. I want to see the actual
TestAssertion
error here
So basically
matcher
support for property based testing
s
Copy code
Caused by: expected: true but was: false
So you want that to include the full stack ?
s
Yes
s
Yeah I agree. I’d consider that a bug tbh as it should alraedy do that.
s
Caused by: expected: true but was: false
This shouldn’t happen. This happens because you try/catch and swallow the exception from
shouldBe
So if I throw in
forAll
you catch it and show
Caused by: expected: true but was: false
2? 🤔
I looked at this code earlier today in KotlinTest. What would you expect here instead?
To simply not try/catch? I can try modifying the code, see if the build still passes and create a PR if you like.
s
Yeah but we have the exception so we can log it rather than doing e.message which is probably what e’re doing
Sure feel free !