Skip to content

Commit

Permalink
[no ci] test FREM (java-decompiler#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauma109 authored Dec 6, 2022
1 parent 01ef74b commit 3427f06
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/test/java/org/jd/core/v1/MiscTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,26 @@ public class MiscTest extends AbstractJdTest {
// // Recompile decompiled source code and check errors
// assertTrue(CompilerUtil.compile("1.8", new InMemoryJavaSourceFileObject(internalClassName, source)));
// }


@Test
public void testFREM() throws Exception {
class FREM {
@SuppressWarnings("unused")
float frem(float a, float b) {
return a % b;
}
}
String internalClassName = FREM.class.getName().replace('.', '/');
String source = decompileSuccess(new ClassPathLoader(), new PlainTextPrinter(), internalClassName);

// Check decompiled source code
assertTrue(source.matches(PatternMaker.make("float frem(float a, float b) {")));
assertTrue(source.matches(PatternMaker.make("return a % b;")));

// Recompile decompiled source code and check errors
assertTrue(CompilerUtil.compile("1.4", new InMemoryJavaSourceFileObject(internalClassName, source)));
}

@Test
public void testFileFilterUtils() throws Exception {
abstract class FileFilterUtils {
Expand Down

0 comments on commit 3427f06

Please sign in to comment.