Skip to content

Critical Update to testcase/assert Library: Improved Assertion Function Handling!

Compare
Choose a tag to compare
@adamluzsi adamluzsi released this 26 Aug 22:31
· 61 commits to main since this release

Hello, testing enthusiasts! 🚀

We've got some important news to share based on the invaluable feedback from our community. There's been a common misstep in how some of our users have been utilizing assertion functions with testcase, and we've taken steps to address it.

The Issue:
Several of you have been inadvertently using assertion functions meant for a single parameter with two parameters. A typical example we've seen:

assert.Error(t, expectedErr, actualErr, "expectation message")

This isn't ideal because the third argument for these functions isn't for comparison but is a variadic assertion message argument. In such cases, expectedErr gets checked as an error, and actualErr is interpreted as a failure assertion message.

Our Solution:
We've updated the function's signature to mitigate this and ensure clarity in function usage. It now mandates a string-based type for assertion failure messages. This change ensures that the compiler will flag any type mismatches, making it much more challenging to misuse the function.

We're confident that this update will streamline your testing experience and reduce inadvertent errors. We recommend updating your testcase/assert library to the latest version to leverage this enhancement.

Your feedback drives our improvements, and we're grateful for your continued support and insights. Please don't hesitate to reach out with any questions, concerns, or further feedback.

Happy coding, and thank you for being an integral part of our community! 🚀