/***************************************************
 ** @author   STF 572 (updated by TTF T014)
 ** @version  0.0.1
 ** @purpose  1:16.1.2,  Ensure that the IUT recognizes any2unistr predefined functions with format "canonical"
 ** @verdict  pass accept, ttcn3verdict:pass

 ***************************************************/

/* The following requirements are tested:
    C.1.33: When the optional format parameter takes the value "canonical": unbound fields are represented in the
    output as "-", the fields and members of structured types are represented recursively in assignment notation.
*/


module Sem_160102_predefined_functions_108 {

        type record MyRec {
        integer field1,
        boolean field2,
        integer field3 optional
    };
    type component GeneralComp {
    }

    testcase TC_Sem_160102_predefined_functions_108 () runs on GeneralComp {

        var template MyRec v_4 := {1,false,-};

        if(match(any2unistr(v_4, "canonical"), pattern "\s#(,)\{\s#(,)field1\s#(,):=\s#(,)1\s#(,)\,\s#(,)field2\s#(,):=\s#(,)false\s#(,)\,\s#(,)field3\s#(,):=\s#(,)(\-)\s#(,)\}\s#(,)")) {
            setverdict(pass,"Result: ",any2unistr(v_4));
        } else {
            setverdict(fail,"Result is: ",any2unistr(v_4), " Expected:{ field1 := 1, field2 := false, field3 := UNINITIALIZED }");
        }
   }

    control{
        execute(TC_Sem_160102_predefined_functions_108());

    }

}
