Catch2 icon indicating copy to clipboard operation
Catch2 copied to clipboard

Dynamic BDD-style macros

Open Minoru opened this issue 4 years ago • 2 comments

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.

Minoru avatar Mar 30 '22 19:03 Minoru

+1

Also for TEMPLATE_LIST_SCENARIO and such (i.e. template analogues for BDD).

ymarcov avatar Dec 22 '22 19:12 ymarcov