Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorSimhon Chourasia2023-12-10 16:35:54 -0500
committerGitHub2023-12-10 22:35:54 +0100
commitd4e9fb8aa578d8b10d91a1c86c5b32c16ced8956 (patch)
tree0d3b5f4c42166d4319d8d0495f17a9afea2403a9 /docs
parentb606bc280226d9b34a42ad82f66cbfcc89209d9e (diff)
downloadcatch3-d4e9fb8aa578d8b10d91a1c86c5b32c16ced8956.tar.gz
Highlight that SECTIONs rerun the entire test case from beginning (#2749)
Diffstat (limited to 'docs')
-rw-r--r--docs/tutorial.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/tutorial.md b/docs/tutorial.md
index 342c7381..dfccac88 100644
--- a/docs/tutorial.md
+++ b/docs/tutorial.md
@@ -119,7 +119,7 @@ This is best explained through an example ([code](../examples/100-Fix-Section.cp
```c++
TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
-
+ // This setup will be done 4 times in total, once for each section
std::vector<int> v( 5 );
REQUIRE( v.size() == 5 );
@@ -152,11 +152,12 @@ TEST_CASE( "vectors can be sized and resized", "[vector]" ) {
}
```
-For each `SECTION` the `TEST_CASE` is executed from the start. This means
+For each `SECTION` the `TEST_CASE` is **executed from the start**. This means
that each section is entered with a freshly constructed vector `v`, that
we know has size 5 and capacity at least 5, because the two assertions
-are also checked before the section is entered. Each run through a test
-case will execute one, and only one, leaf section.
+are also checked before the section is entered. This behaviour may not be
+ideal for tests where setup is expensive. Each run through a test case will
+execute one, and only one, leaf section.
Section can also be nested, in which case the parent section can be
entered multiple times, once for each leaf section. Nested sections are