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):
|
def test_coverage(self):
|
||||||
p = self.parser.parse('''
|
p = self.parser.parse('''
|
||||||
float f=2+2;
|
float f=2+llAbs(-2);
|
||||||
float g = f;
|
float g = f;
|
||||||
string s = "1" "2";
|
string s = "1" "2";
|
||||||
list L = [(key)""];
|
list L = [(key)""];
|
||||||
default{timer(){
|
vector v=<1,2,f>;
|
||||||
1+([]+(integer)~1);
|
float ffff2 = v.x; // This needs a bit of luck for coverage, as it's order-dependent.
|
||||||
list a;
|
vector vvvv = <1,2,llGetNumberOfSides()>;
|
||||||
float f;
|
float ffff=vvvv.x;
|
||||||
integer j = 3||4&&5|6^7&8.==9!=10.e+01f<11<=12>13.>=14<<15>>16==0&&3==
|
vector vvvv2=vvvv;
|
||||||
++f-f++-(3 + llFloor(f)<<3 << 32) - 2 - 0;
|
float ffff3 = v.z;
|
||||||
integer k = 2 + (3 * 25 - 4)/2 % 9;
|
|
||||||
a = 3; a += !3;
|
default{touch(integer n){
|
||||||
f += 4; f += -4.3;
|
1+([]+(integer)~1);
|
||||||
integer i;
|
list a;
|
||||||
for(i=3,i;1;){}
|
float f;
|
||||||
i |= !i;
|
vector v=<1,2,f>;<1,2,3>;<1,2,3,4>;v.x;
|
||||||
"a" "b" "c";
|
integer j = 3||4&&5|6^7&8.==9!=10.e+01f<11<=12>13.>=14<<15>>16==0&&3==
|
||||||
"a"+(key)"b"; (key)"a" + "b";
|
++f-f++-(3 + llFloor(f)<<3 << 32) - 2 - 0;
|
||||||
i>>=i;
|
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',
|
['explicitcast','extendedtypecast','extendedassignment',
|
||||||
'extendedglobalexpr', 'allowmultistrings', 'allowkeyconcat']
|
'extendedglobalexpr', 'allowmultistrings', 'allowkeyconcat']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue