-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Just some documentation. #2541
base: devel
Are you sure you want to change the base?
Just some documentation. #2541
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #2541 +/- ##
==========================================
+ Coverage 91.57% 91.58% +0.01%
==========================================
Files 183 183
Lines 7564 7564
==========================================
+ Hits 6926 6927 +1
+ Misses 638 637 -1 |
Is there anything I should do here? |
Hi, sorry for taking so long. Your PR happens to be in the goldilocks zone of not being good enough to approve outright, not being bad enough to reject and the subject matter not being interesting enough to prioritize (small doc update versus Anyway, I think the PR should be split into two, so they can progress separately. I recommend moving the lambda part into its own PR (I'll leave some notes on that separately), and leaving the include docs in this one. |
} | ||
``` | ||
[godbolt](https://catch2.godbolt.org/z/ebdr9vKcj) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shows, but doesn't explain to non-experts, an important feature: the fact that assertions can happen outside the TEST_CASE
.
There is also something interesting to be said about lambdas specifically: how do their capture lists behave across multiple invocations (due to SECTION
s).
So I would like to see a bit of text first explaining assertions in separate functions, then another piece about lambdas.
@@ -16,6 +16,9 @@ Catch is different. Because it decomposes natural C-style conditional expression | |||
Most of these macros come in two forms: | |||
|
|||
## Natural Expressions | |||
```cpp | |||
#include <catch2/catch_test_macros.hpp> | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this format for larger sections (ideally with their own headings) 👍
```cpp | ||
#include <catch2/generators/catch_generators_random.hpp> | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I don't like it for lists, and I don't like adding new sections just to have the include paths in them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is enough extra information to be mentioned about the random generators (e.g. their repeatability guarantees) that this subheading could be filled out to be meaningful.
However, I don't see this also being true for the range
generator, so we will need a different format for inline markings of things in lists.
### Range generators | ||
```cpp | ||
#include <catch2/generators/catch_generators_range.hpp> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the text below now reads as part of the range
generators.
Description
Adding includes to the documentation and a basic test case with a lambda.
GitHub Issues
#2519 - Added headers for parts of Catch2 that I am aware of.
#2513 - Basic test case with a lambda.