test: enum used in other field init

This commit is contained in:
Skylot 2024-02-06 18:28:52 +00:00
parent 276ee537e1
commit 5b8793155c
No known key found for this signature in database
GPG Key ID: 47866607B16F25C8

View File

@ -0,0 +1,32 @@
package jadx.tests.integration.enums;
import jadx.tests.api.IntegrationTest;
import jadx.tests.api.extensions.profiles.TestProfile;
import jadx.tests.api.extensions.profiles.TestWithProfiles;
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
@SuppressWarnings("unused")
public class TestEnums11 extends IntegrationTest {
public static class TestCls {
public enum Mode {
FIRST,
SECOND,
THIRD;
private static final Mode DEFAULT = THIRD;
public static Mode getDefault() {
return DEFAULT;
}
}
}
@TestWithProfiles(TestProfile.D8_J11)
public void test() {
assertThat(getClassNode(TestCls.class))
.code()
.containsOne("private static final Mode DEFAULT = THIRD;");
}
}