openmainframeproject/cobol-check

Support for ending execution of a unit test in a mock

Rune-Christensen opened this issue · 0 comments

We have a testscenario, where we want to mock a section that performs a goback, but the functionality of the goback needs to be preserved, to avoid bad tests.
Example:
EXAMPLE SECTION. PERFORM DO-SOMETHING IF DO-SOMETHING-WENT-BAD PERFORM SECTION-WITH-GOBACK END-IF PERFORM DO-SOMETHING-MORE .
If I create a test of example section, and make sure that we enter the SECTION-WITH-GOBACK, we want to mock that section, so we do not goback, but we want to exit the testcase, because we do not want to perform the section do-something-more, as that would not normally be executed.

This could of course be fixed with a little bit of refactoring, but I also know of many who use this syntax.