neopragma/cobol-unit-test

Ensure the framework supports "classic" Cobol style

Closed this issue · 2 comments

Support code written with a period at the end of each sentence.

"Classic" style means every sentence ends with a period.

2000-BRILLIANT-PARAGRAPH.
    IF PROD-QUANTITY IS GREATER THAN 1
        MULTIPLY PROD-QUANTITY BY PROD-UNIT-PRICE
           GIVING LINE-EXTENDED-PRICE
    ELSE
        MOVE PROD-UNIT-PRICE TO LINE-EXTENDED-PRICE.
    PERFORM 3000-APPLY-DISCOUNTS.
    PERFORM 4000-APPLY-SALES-TAX.

"Modern" (a relative term) style omits periods except where the compiler requires them.

2000-BRILLIANT-PARAGRAPH.
    IF PROD-QUANTITY IS GREATER THAN 1
        MULTIPLY PROD-QUANTITY BY PROD-UNIT-PRICE
           GIVING LINE-EXTENDED-PRICE
    ELSE
        MOVE PROD-UNIT-PRICE TO LINE-EXTENDED-PRICE
    END-IF
    PERFORM 3000-APPLY-DISCOUNTS
    PERFORM 4000-APPLY-SALES-TAX
    .

The current implementation can parse "modern" style in the original source file and the unit test file. We want to support "classic" style both for the original source and the unit tests.

Added support for the code under test to be 'classic' style. The test cases themselves must be 'modern' style and all caps.