Commit 17e2e3b0 authored by Matthias Simon's avatar Matthias Simon
Browse files

Merge branch '5-automatic-type-for-index-assignment-lists' into 'main'

Resolve "Automatic type for index assignment lists."

Closes #5

See merge request k3/ttcn3-conformance-tests!6
parents 5642490d 30154873
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
// @author   TTF23
// @purpose  1:6.5, Ensure index list with common key type keys is a map.
// @verdict  pass reject
module NegSem_0605_index_lists_001 {

type component GeneralComp {}

testcase TC_NegSem_0605_index_lists_001() runs on GeneralComp {
	var v := { ["Hello"] := 1, [1] := 2 };
}

control {
    execute(TC_NegSem_0605_index_lists_001());
}

}
+19 −0
Original line number Diff line number Diff line
// @author   TTF23
// @purpose  1:6.5, Ensure index list with integer key type is a record of.
// @verdict  pass accept
module Sem_0605_index_lists_001 {

type component GeneralComp {}

type record of universal charstring RoUC;

testcase TC_Sem_0605_index_lists_001() runs on GeneralComp {
	var v := { [1] := "Hello", [3] := -, [5] := "Wörld" };
	var RoUC r := v;
}

control {
    execute(TC_Sem_0605_index_lists_001());
}

}
+19 −0
Original line number Diff line number Diff line
// @author   TTF23
// @purpose  1:6.5, Ensure index list with common key type keys is a map.
// @verdict  pass accept
module Sem_0605_index_lists_002 {

type component GeneralComp {}

type map from float to charstring M;

testcase TC_Sem_0605_index_lists_002() runs on GeneralComp {
	var v := { [1.0] := "a", [2.1] := "b" };
	var M m := v;
}

control {
    execute(TC_Sem_0605_index_lists_002());
}

}
+19 −0
Original line number Diff line number Diff line
// @author   TTF23
// @purpose  1:6.5, Ensure index list with common key type keys is a map.
// @verdict  pass accept
module Sem_0605_index_lists_003 {

type component GeneralComp {}

type map from universal charstring to integer M;

testcase TC_Sem_0605_index_lists_003() runs on GeneralComp {
	var v := { ["Hello"] := 5, ["Wörld"] := 23 };
	var M m := v;
}

control {
    execute(TC_Sem_0605_index_lists_003());
}

}