mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Add more documentation to BDD macros
This commit is contained in:
parent
6734c0aa64
commit
9f44bd57f1
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user