openmainframeproject / cobol-check

A testing framework for Cobol applications
Apache License 2.0
78 stars 28 forks source link

Replace statements after mocked sections are handled wrong #277

Closed Rune-Christensen closed 11 months ago

Rune-Christensen commented 1 year ago

This code: image

Results in this generated code: image

The correct code should have the eyecatcher begin and end, and the end-evaluate between them, before the replace statement.

Freedisch commented 1 year ago

@Rune-Christensen , Hello, I'm Freedisch Thibaut Batale and I'm really interested about working on this project as an LFX mentee for this summer. I would like to work on this issue to get familiar with the project

dakaa16 commented 1 year ago

Hi Freedisch, thank you for your interest. Please feel free to go ahead

AkashKumar7902 commented 1 year ago

@Freedisch Hey, Are you still working on this issue ?

AkashKumar7902 commented 12 months ago

Hey @Rune-Christensen I am unable to reproduce the error. I have the following procedure division in my program under test

       PROCEDURE DIVISION.
      ******************************************************************
       MOCK-SECTION SECTION.
           CONTINUE
           .
           REPLACE ==:AAA:== BY ==BBB==.
      ******************************************************************

I have a single test file for this program with the following contents:

    TestSuite "Test"
    MOCK SECTION MOCK-SECTION
    END-MOCK
    PERFORM MOCK-SECTION
    TestCase "Test"
    PERFORM MOCK-SECTION

the content of MOCK-SECTION in CC##99.CBL is :

      ******************************************************************        
       MOCK-SECTION SECTION.                                                    
            EVALUATE UT-TEST-SUITE-NAME                                         
                   ALSO UT-TEST-CASE-NAME                                       
                WHEN "Test"                                                     
                   ALSO ANY                                                     
                    PERFORM UT-1-0-1-MOCK                                       
           WHEN OTHER                                                           
                    PERFORM UT-1-1-0-WO                                         
            END-EVALUATE                                                        
           .                                                                    

      *****************************************************************         
      *WhenOther Paragraph or Section called                                    
      *****************************************************************         
       UT-1-1-0-WO SECTION.                                                     
      *****************************************************************         
      *WhenOther of: SECTION: MOCK-SECTION                                      
      *****************************************************************         
           CONTINUE                                                             
           .                                                                    
           REPLACE ==:AAA:== BY ==BBB==.                                        
           .                                                                    
           .                                                                    

      ******************************************************************        

Please suggest changes so I would be successful in reproducing the error

Regards, Akash Kumar

AkashKumar7902 commented 11 months ago

hey @Rune-Christensen, any updates on this ?

Rune-Christensen commented 11 months ago

Hi @AkashKumar7902 Sorry for not responding to this. Your example is correct. I think this issue was fixed by Issac, when he solved another issue. I am closing this. Thank you