Commit 30154873 authored by Matthias Simon's avatar Matthias Simon
Browse files

Add tests for index assignment lists

parent 5642490d
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());
}

}