Add forgotten unit tests for the identifier substitution fiasco

This commit is contained in:
Sei Lisa 2019-01-11 21:18:25 +01:00
parent 0877f8c7e6
commit 352f410d12
3 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,25 @@
default
{
state_entry()
{
list L1 = [1, 2, 3, 4, 5];
integer N = llGetListLength(L1);
integer i;
for (i = 0; i < N; i++)
{
llOwnerSay(llList2String(L1, i));
L1 = llDeleteSubList(L1, -1, -1);
}
// Swap two variables
integer u = llGetLinkNumber();
integer v = llGetNumberOfPrims();
if (llFrand(1) < 0.5)
{
integer temp = u;
u = v;
v = temp;
}
llOwnerSay((string)u+(string)v);
}
}

View file

@ -0,0 +1,23 @@
default
{
state_entry()
{
list loc_L1 = (list)1 + 2 + 3 + 4 + 5;
integer loc_N = loc_L1 != [];
integer loc_i;
for (loc_i = 0; loc_i < loc_N; ++loc_i)
{
llOwnerSay(llList2String(loc_L1, loc_i));
loc_L1 = llDeleteSubList(loc_L1, ((integer)-1), ((integer)-1));
}
integer loc_u = llGetLinkNumber();
integer loc_v = llGetNumberOfPrims();
if (llFrand(1) < 0.5)
{
integer loc_temp = loc_u;
loc_u = loc_v;
loc_v = loc_temp;
}
llOwnerSay((string)loc_u + (string)loc_v);
}
}

View file

@ -0,0 +1 @@
main.py - -y -O shrinknames