/******************************************************************************
 * Copyright (c) ETSI 2017.
 *
 * This file is subject to copyrights owned by ETSI. Non-exclusive permission
 * is hereby granted, free of charge, to copy, reproduce and amend this file
 * under the following conditions: It is provided "as is", without warranty of any
 * kind, expressed or implied.
 * 
 * ETSI shall never be liable for any claim, damages, or other liability arising
 * from its use or inability of use.This permission does not apply to any documentation
 * associated with this file for which ETSI keeps all rights reserved. The present
 * copyright notice shall be included in all copies of whole or part of this
 * file and shall not imply any sub-license right.
 *
 * Modified by: Adrien Kirjak
 *
 ** @version  0.0.1
 ** @purpose  1:6.1.1, Assign and read universal charstring using USI like notation
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

/* The following requirements are tested:
 The UCS sequence identifier-like (USI-like) notation using their short identifiers of code point. The USI-like notation is composed of the keyword char followed by parentheses. The
parentheses enclose a comma-separated list of short identifiers . Each short identifier represents a single
character and it shall be composed of a letter U or u followed by an optional "+" PLUS SIGN character,
followed by 1..8 hexadecimal digits. 
*/

module Sem_060101_TopLevel_007 {
    
    type component GeneralComp {}
    
    testcase TC_Sem_060101_TopLevel_007() runs on GeneralComp {
        var universal charstring v_a  :=  char(U0041);  //USI notation for character "A"
        var universal charstring v_b  :=  char(U0171);  //USI notation for character "ű"
        var universal charstring v_c  :=  char(U41);    //USI notation for character "A" without leading zeroes
        var universal charstring v_d  :=  char(U+171,U41);  //USI notation for character "ű" and "A"  without leading zeroes and + sign notation

  	var universal charstring a_exp := "A";
    var universal charstring b_exp := "ű";
	var universal charstring c_exp := "A";
	var universal charstring d_exp := "űA";      
               
    	if (match(v_a,a_exp) and 
            match(v_b,"ű") and
            match(v_c,c_exp) and
            match(v_d,"űA"))
        {
    		setverdict(pass,"v_a:",v_a, "v_b:",v_b, "v_c:",v_c,"v_d:",v_d);
    	}
    	else {
    		setverdict(fail,"v_a:",v_a, "v_b:",v_b, "v_c:",v_c,"v_d:",v_d);
    	}
    }
    
    control{
        execute(TC_Sem_060101_TopLevel_007());
    }
}


