/*****************************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:15.11, Concatenating charstring templates: * length(n)
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// The following requirements are tested:
// Single templates of charstring and universal charstring types shall contain evaluate only to specific values only,
// AnyValue with or without a length modifier, AnyValueOrNone with a length modifier or pattern.
// The concatenation of templates of character string types results in the sequential concatenation of the single templates
// from left to right. In case all operands are specific values, the result of concatenation will be a specific value.
// In all other cases, if possible, a pattern will be produced. When producing the pattern, the templates are first
// transformed to a character string according to table 14. In the next step, the strings are concatenated and a pattern is
// created from the concatenation result.
// Concatenation operand: * length(n)
// Transformed string: ?#(n)

module Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027 {
    type component GeneralComp { }
    template charstring m_str := "ABC";
    template charstring m_str2 := m_str & * length(2);

    testcase TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027() runs on GeneralComp {
        log(m_str2);
        if (match("ABCD", m_str2) or match("ABCDEF", m_str2)) {
            setverdict(fail);
        } else if (match("ABCDE", m_str2)) {
            setverdict(pass);
        } else {
            setverdict(fail);
        }
    }

    control {
        execute(TC_Sem_1511_ConcatenatingTemplatesOfStringAndListTypes_027());
    }
}