/***************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:6.2.13.2, ensure that list subtyping check for array types is properly handled
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
// The following requirement is tested:
//Subtypes defined by a list subtyping restrict the allowed values of the subtype to the values
//matched by at least one of the constraints in the list.
//In case of list subtyping of record, set, record of, set of, union and anytype types, and arrays,
//the list may contain both subtypes and possibly partial templates of the parent types.

module Sem_06021302_ListSubtyping_004 {

 type component GeneralComp {
 }

type charstring MyArray[1 .. 3];

type MyArray MyArraySub1 (
            { "aa", "bb", "cc" },
            { "dd", "ee", "ff" }
); // valid subtype of MyArray

type MyArraySub1 MyArraySub2 ( { "aa", "bb", "cc" } ); // valid subtype of MyArraySub1
type MyArraySub1 MyArraySub3 ( { "dd", "ee", "ff" } ); // valid  subtype of MyArraySub1
type MyArraySub1 MyArraySub4 ( MyArraySub2 ); // valid  subtype of MyArraySub1

testcase TC_Sem_06021302_ListSubtyping_004() runs on GeneralComp {
 var MyArray v_array := { "aa", "bb", "cc" };
 template MyArraySub1 m_match := { "aa", "bb", "cc" };

      if ( match(v_array ,m_match) ) {
	    setverdict(pass);
      }
      else {
	    setverdict(fail);
	  }

}

control {
    execute(TC_Sem_06021302_ListSubtyping_004());
}

}
