mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Expand the test case to include more coverage. Triggers errors.
This commit is contained in:
parent
e57c21a73a
commit
19ca34d7e0
1 changed files with 26 additions and 16 deletions
|
@ -224,25 +224,35 @@ class Test03_Optimizer(UnitTestCase):
|
|||
|
||||
def test_coverage(self):
|
||||
p = self.parser.parse('''
|
||||
float f=2+2;
|
||||
float f=2+llAbs(-2);
|
||||
float g = f;
|
||||
string s = "1" "2";
|
||||
list L = [(key)""];
|
||||
default{timer(){
|
||||
1+([]+(integer)~1);
|
||||
list a;
|
||||
float f;
|
||||
integer j = 3||4&&5|6^7&8.==9!=10.e+01f<11<=12>13.>=14<<15>>16==0&&3==
|
||||
++f-f++-(3 + llFloor(f)<<3 << 32) - 2 - 0;
|
||||
integer k = 2 + (3 * 25 - 4)/2 % 9;
|
||||
a = 3; a += !3;
|
||||
f += 4; f += -4.3;
|
||||
integer i;
|
||||
for(i=3,i;1;){}
|
||||
i |= !i;
|
||||
"a" "b" "c";
|
||||
"a"+(key)"b"; (key)"a" + "b";
|
||||
i>>=i;
|
||||
vector v=<1,2,f>;
|
||||
float ffff2 = v.x; // This needs a bit of luck for coverage, as it's order-dependent.
|
||||
vector vvvv = <1,2,llGetNumberOfSides()>;
|
||||
float ffff=vvvv.x;
|
||||
vector vvvv2=vvvv;
|
||||
float ffff3 = v.z;
|
||||
|
||||
default{touch(integer n){
|
||||
1+([]+(integer)~1);
|
||||
list a;
|
||||
float f;
|
||||
vector v=<1,2,f>;<1,2,3>;<1,2,3,4>;v.x;
|
||||
integer j = 3||4&&5|6^7&8.==9!=10.e+01f<11<=12>13.>=14<<15>>16==0&&3==
|
||||
++f-f++-(3 + llFloor(f)<<3 << 32) - 2 - 0;
|
||||
integer k = 2 + (3 * 25 - 4)/2 % 9;
|
||||
a = 3; a += !3;
|
||||
f += 4; f += -4.3;
|
||||
integer i;
|
||||
print(3+2);
|
||||
for(i=3,i;1;){}
|
||||
i |= !i;
|
||||
"a" "b" "c";
|
||||
"a"+(key)"b"; (key)"a" + "b";
|
||||
i>>=i;
|
||||
if (1) do while (0); while (0); if (0) ; else ;
|
||||
}}''',
|
||||
['explicitcast','extendedtypecast','extendedassignment',
|
||||
'extendedglobalexpr', 'allowmultistrings', 'allowkeyconcat']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue