-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically append ArrowError messages to failed test assertions #565
Comments
I definitely support this initiative - improving these error messages would be immensely helpful I am no expert in GTest so open to whatever you think is best. I believe arrow-adbc creates GTest matchers like |
Thanks for opening! It has been suggested before that we have an One thing that has come up for me in testing is that I would love is to know where a non-
I'm a skeptical of the magic here...I'd rather have it as an argument to the macro (or matcher) to make it easier for a new or occasional contributor to pick up what's going on. |
FWIW, GTest has a macro called MATCHER_P that makes it much easier to define matchers like that (instead of writing it out by hand) |
I opened #567 to track that |
Many functions in nanoarrow accept an
ArrowError*
which receives a message describing the error; frequently more informative than theArrowErrorCode
. Although there are tests asserting error message content, most other tests ignore the error message entirely. This can make debugging those other tests frustrating and leads to ad-hoc assertions likeEXPECT_EQ(ArrowIpcDecoderVerifyHeader(&decoder, data, &error), NANOARROW_OK) << error.message;
There are a couple of GTest tricks we could use to be more ergonomic, like defining a new assertion macro:
It'd even be possible to elide the extra macro argument by introducing a C++ wrapper for ArrowError:
The text was updated successfully, but these errors were encountered: