diff options
| author | Martin Hořeňovský | 2021-03-23 13:02:07 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-03-23 13:02:07 +0100 |
| commit | 9f44bd57f1c44e5dabc9825b06ee7c865e6253e6 (patch) | |
| tree | d0f1d58bcafd69e1ed841fa1f5df631bd3d19e3f /docs/test-cases-and-sections.md | |
| parent | 6734c0aa643a58ff7daaa005bb4ce79c67e43cfc (diff) | |
| download | catch3-9f44bd57f1c44e5dabc9825b06ee7c865e6253e6.tar.gz | |
Add more documentation to BDD macros
Diffstat (limited to 'docs/test-cases-and-sections.md')
| -rw-r--r-- | docs/test-cases-and-sections.md | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/test-cases-and-sections.md b/docs/test-cases-and-sections.md index 4899af0e..48be68dc 100644 --- a/docs/test-cases-and-sections.md +++ b/docs/test-cases-and-sections.md @@ -132,8 +132,21 @@ SCENARIO( "vector can be sized and resized" ) { } } ``` -See [this working example](https://godbolt.org/z/e5vPPM), with an intentional failure to demonstrate the reporting -output. + +This code will result in two runs through the scenario: +``` +Scenario : vector can be sized and resized + Given : An empty vector + Then : The size and capacity start at 0 + +Scenario : vector can be sized and resized + Given : An empty vector + When : push_back() is called + Then : The size changes +``` + +See also [runnable example on godbolt](https://godbolt.org/z/e5vPPM), +with a more complicated (and failing) example. > `AND_GIVEN` was [introduced](https://github.com/catchorg/Catch2/issues/1360) in Catch2 2.4.0. |