mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-23 07:35:33 +00:00
AS2 parsing tests fix, +new test
This commit is contained in:
@@ -81,4 +81,19 @@ public class ActionScript2ParserTest extends ActionStript2TestBase {
|
||||
" }\n" +
|
||||
"}");
|
||||
}
|
||||
|
||||
@Test
|
||||
private void testAS2Parse5() {
|
||||
parseAS2(
|
||||
"if(!test.T1)\n" +
|
||||
"{\n" +
|
||||
" test.T1 = function()\n" +
|
||||
" {\n" +
|
||||
" super();\n" +
|
||||
" }.Initialize = function(obj)\n" +
|
||||
" {\n" +
|
||||
" var x = 1;\n" +
|
||||
" };\n" +
|
||||
"}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public class RecompileTest {
|
||||
HilightedTextWriter writer = new HilightedTextWriter(new CodeFormatting(), false);
|
||||
Action.actionsToSource(asm, asm.getActions(), asm.toString()/*FIXME?*/, writer);
|
||||
String as = writer.toString();
|
||||
asm.removePrefixAndSuffix(as);
|
||||
as = asm.removePrefixAndSuffix(as);
|
||||
ActionScriptParser par = new ActionScriptParser();
|
||||
try {
|
||||
asm.setActions(par.actionsFromString(as));
|
||||
@@ -98,7 +98,7 @@ public class RecompileTest {
|
||||
writer = new HilightedTextWriter(new CodeFormatting(), false);
|
||||
Action.actionsToSource(asm, asm.getActions(), asm.toString()/*FIXME?*/, writer);
|
||||
String as2 = writer.toString();
|
||||
asm.removePrefixAndSuffix(as2);
|
||||
as2 = asm.removePrefixAndSuffix(as2);
|
||||
try {
|
||||
asm.setActions(par.actionsFromString(as2));
|
||||
} catch (ParseException ex) {
|
||||
@@ -107,7 +107,7 @@ public class RecompileTest {
|
||||
writer = new HilightedTextWriter(new CodeFormatting(), false);
|
||||
Action.actionsToSource(asm, asm.getActions(), asm.toString()/*FIXME?*/, writer);
|
||||
String as3 = writer.toString();
|
||||
asm.removePrefixAndSuffix(as3);
|
||||
as3 = asm.removePrefixAndSuffix(as3);
|
||||
if (!as3.equals(as2)) {
|
||||
fail("ActionScript is diffrent: " + item.getSwf().getShortFileName() + "/" + item.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user