-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
improve sub case text references #406
Comments
The idea behind the "current" is that we might have popped a subcase or two compared to the deepest stack we might have encountered in the current entrance of this test case. Example: TEST_CASE("lots of nested subcases") {
SUBCASE("1") {
SUBCASE("2") {}
CHECK(false);
}
} when we hit the assert the deepest stack is
and both the current and the deepest subcase stacks are printed, but I guess the current output is confusing. One other consideration behind the separate rows for each subcase is BDD-style test cases - they are effectively subcases but with a prefix (either Also if the names of subcases are too long then printing everything on a single line will not be readable/optimal either. However, I agree with you that the current output is weird/confusing/ugly and for short subcase names I would totally prefer your proposal. Perhaps the order of the current/deepest should be switched (so that the deepest is printed first and the current is printed after that - closer to the actual error). Perhaps we could make a new dedicated macro for BDD-style subcases which has an additional flag to distinguish it from the normal ones, so that they are printed differently... |
Ah ok I used that pattern in value-parameterized tests. |
Displaying as a tree seems like the right way to go indeed, and we could display the deepest nodes of the tree after a row saying |
Extracted from #321 (comment):
The message could be improved:
I have no clue what the "CURRENT ONE" is and how it's different. Looks like implementation details to me.
Should be something simple like
Nested cases could be printed like
("3" / "4" / ...)
I guess.The text was updated successfully, but these errors were encountered: