Commit 0911b2dc authored by Skylot's avatar Skylot

test: NYI test for issue #722

parent fd7d08cb
package jadx.tests.integration.conditions;
import org.junit.jupiter.api.Test;
import jadx.NotYetImplemented;
import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;
import static jadx.tests.api.utils.JadxMatchers.containsOne;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
public class TestConditions19 extends IntegrationTest {
public static class TestCls {
private String result;
@SuppressWarnings("checkstyle:InnerAssignment")
public void test(String str) {
int len;
if (str.isEmpty() || (len = str.length()) > 5) {
result += "bad";
} else {
result += "good, len: " + len;
}
result += ", str: " + str;
System.out.println("done");
}
private String runTest(String str) {
result = "";
test(str);
return result;
}
public void check() {
assertThat(runTest(""), is("bad, str: "));
assertThat(runTest("1234"), is("good, len: 4, str: 1234"));
assertThat(runTest("1234567"), is("bad, str: 1234567"));
}
}
@Test
@NotYetImplemented("Inner assignment or labeled block with break")
public void test() {
noDebugInfo();
ClassNode cls = getClassNode(TestCls.class);
String code = cls.getCode().toString();
assertThat(code, containsOne("System.out.println(\"done\");"));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment