Catch2
Catch2 copied to clipboard
Dynamic BDD-style macros
Description
DYNAMIC_SECTION makes it easy to generate portions of test cases. However, when used inside a BDD scenario, it results in unsightly output when a test fails:
Scenario: move_up() returns true if cursor position changed
Given: a ListWidget with 3 lines
cursor on position 2
moving up and wrap_scroll is false
Then: true is returned and cursor moves to position 1
As you can see, a couple lines weren't prefixed with BDD terms.
It would be nice to have DYNAMIC_ counterparts to all the BDD macros, so the output looked like this:
Scenario: move_up() returns true if cursor position changed
Given: a ListWidget with 3 lines
And given: cursor on position 2
When: moving up and wrap_scroll is false
Then: true is returned and cursor moves to position 1
Additional context Add any other context or screenshots about the feature request here.
+1
Also for TEMPLATE_LIST_SCENARIO and such (i.e. template analogues for BDD).