neopragma / cobol-unit-test

Unit testing framework and sample code for batch Cobol programs.
GNU General Public License v3.0
117 stars 36 forks source link

Add support for EIBRCODE mnemonics to improve the DSL for EXEC CICS mocks #62

Open neopragma opened 9 years ago

neopragma commented 9 years ago

This works:

MOCK 
    CICS READ 
        DATASET('SOMEFILE') 
        RIDFLD('THEKEY') 
        INTO(WS-RECORD) 
        LENGTH(WS-RECLEN)
    MOVE 5 TO EIBRCODE
END-MOCK

but this would be more revealing of intent:

MOCK 
    CICS READ 
        DATASET('SOMEFILE') 
        RIDFLD('THEKEY') 
        INTO(WS-RECORD) 
        LENGTH(WS-RECLEN)
    RAISE NOTOPEN      or RAISE NOTOPEN CONDITION    or CONDITION IS NOTOPEN   (etc.)
END-MOCK