Improved tests.

Fixed try..catch..finally.
This commit is contained in:
Jindra Petřík
2021-01-31 15:52:22 +01:00
parent ed5fdc313d
commit adf153e13a
19 changed files with 1418 additions and 772 deletions

View File

@@ -14,11 +14,12 @@ package
TestTryCatchIfInTry;
TestTryCatchLoop;
TestTryCatchExceptionUsage
TestTryFinally;
TestTryFinally;
TestTryFinallyDirectReturnInFinally;
TestTryFinallyLoop;
TestTryFinallyLoopInFinally;
TestTryFinallyMultipleCatch;
TestTryFinallyNoCatch;
TestTryFinallyReturn;
TestTryFinallyReturnInFinally;
TestTryFinallyReturnNested;

View File

@@ -11,14 +11,16 @@ package tests
public function run() : void
{
var j:* = undefined;
for (var i:* = 0; i < 100; i++)
var i:int = 0;
while (i < 100)
{
try
{
for (j = 0; j < 20; j++)
var j:int = 0;
while (j < 20)
{
trace("a");
j++;
}
}
catch (e:EOFError)
@@ -30,6 +32,7 @@ package tests
continue;
}
trace("after_try");
i++;
}
trace("end");
}

View File

@@ -9,7 +9,8 @@ package tests
public function run() : void
{
for (var i:int = 0; i < 10; i++)
var i:int = 0;
while (i < 10)
{
trace("before try");
try
@@ -17,7 +18,8 @@ package tests
trace("in try");
if (i == 5)
{
trace("continue for");
i += 5;
trace("continue while");
continue;
}
}
@@ -30,6 +32,7 @@ package tests
trace("in finally");
}
trace("after");
i++;
}
}

View File

@@ -9,7 +9,8 @@ package tests
public function run() : void
{
for (var i:int = 0; i < 10; i++)
var i:int = 0;
while (i < 10)
{
trace("before try");
try
@@ -24,12 +25,14 @@ package tests
{
if (i == 5)
{
trace("continue for");
i += 7;
trace("continue while");
continue;
}
trace("in finally");
}
trace("after");
i++
}
}

View File

@@ -0,0 +1,26 @@
package tests
{
/**
* ...
* @author JPEXS
*/
public class TestTryFinallyNoCatch
{
public function run() : void
{
trace("before try");
try
{
trace("in try");
}
finally
{
trace("in finally");
}
trace("after");
}
}
}

View File

@@ -9,13 +9,13 @@ package tests
public function run() : String
{
var a:int = Math.random() * 5;
try
{
trace("before try2");
try
{
trace("in try2");
var a:int = 5;
if (a > 4)
{
return "RET";

View File

@@ -9,11 +9,11 @@ package tests
public function run() : void
{
var a:int = Math.random() * 5;
trace("before try");
try
{
trace("in try");
var a:int = 5;
if (a > 4)
{
return;