mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-03 16:35:38 +00:00
AS2 test added
This commit is contained in:
@@ -261,4 +261,30 @@ public class ActionScript2DeobfuscatorTest extends ActionStript2TestBase {
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemoveGetTime() {
|
||||
String actionsString = "ConstantPool \"a\"\n"
|
||||
+ "GetTime\n"
|
||||
+ "If loc1\n"
|
||||
+ "Push \"FAIL\"\n"
|
||||
+ "Trace\n"
|
||||
+ "loc1:Push \"OK\"\n"
|
||||
+ "Trace\n"
|
||||
+ "loc2:";
|
||||
try {
|
||||
List<Action> actions = ASMParser.parse(0, true, actionsString, swf.version, false);
|
||||
|
||||
DoActionTag doa = getFirstActionTag();
|
||||
doa.setActionBytes(Action.actionsToBytes(actions, true, swf.version));
|
||||
HighlightedTextWriter writer = new HighlightedTextWriter(new CodeFormatting(), false);
|
||||
Action.actionsToSource(doa, doa.getActions(), "", writer);
|
||||
String actualResult = writer.toString();
|
||||
|
||||
assertTrue(!actualResult.contains("FAIL"));
|
||||
assertTrue(actualResult.contains("OK"));
|
||||
} catch (IOException | ActionParseException | InterruptedException ex) {
|
||||
fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user