/*****************************************************************
 ** @author   STF 584
 ** @version  0.0.2
 ** @purpose  1:20.4, stop inside interleave
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// Background:
// The stop statement was forbidden inside interleave in TTCN-3:2016 and older

module Sem_2004_InterleaveStatement_009 {

    type port MyPort message {
        inout charstring
    }

    type component GeneralComp {
        port MyPort p;
    }

    testcase TC_Sem_2004_InterleaveStatement_009() runs on GeneralComp {
        p.send(charstring:"foo");
        p.send(charstring:"bar");

        interleave {
            [] p.receive(charstring:"bar") {
                setverdict(pass);
                stop;
            }
            [] p.receive(charstring:"foo") {
            }
        }
    }

    control{
        execute(TC_Sem_2004_InterleaveStatement_009());
    }
}