refactor tests + add static class test
This commit is contained in:
@@ -1,13 +1,18 @@
|
|||||||
package draylar.omegatest;
|
package draylar.omegatest;
|
||||||
|
|
||||||
import draylar.omegaconfig.OmegaConfig;
|
import draylar.omegaconfig.OmegaConfig;
|
||||||
|
import draylar.omegatest.config.ClassConfigTest;
|
||||||
|
import draylar.omegatest.config.NestedConfigTest;
|
||||||
|
import draylar.omegatest.config.StructuresConfigTest;
|
||||||
|
import draylar.omegatest.config.SimpleConfigTest;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
|
|
||||||
public class OmegaTestMain implements ModInitializer {
|
public class OmegaTestMain implements ModInitializer {
|
||||||
|
|
||||||
public static final TestConfig CONFIG = OmegaConfig.register(TestConfig.class);
|
public static final SimpleConfigTest CONFIG = OmegaConfig.register(SimpleConfigTest.class);
|
||||||
public static final NewTestConfig MO_CONFIG = OmegaConfig.register(NewTestConfig.class);
|
public static final StructuresConfigTest MO_CONFIG = OmegaConfig.register(StructuresConfigTest.class);
|
||||||
public static final NestedConfig NESTED = OmegaConfig.register(NestedConfig.class);
|
public static final NestedConfigTest NESTED = OmegaConfig.register(NestedConfigTest.class);
|
||||||
|
public static final ClassConfigTest CLASS = OmegaConfig.register(ClassConfigTest.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package draylar.omegatest.config;
|
||||||
|
|
||||||
|
import draylar.omegaconfig.api.Config;
|
||||||
|
|
||||||
|
public class ClassConfigTest implements Config {
|
||||||
|
|
||||||
|
public TestClass[] testClass = {
|
||||||
|
new TestClass()
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "class-config";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TestClass {
|
||||||
|
public boolean a = true;
|
||||||
|
public int b = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package draylar.omegatest;
|
package draylar.omegatest.config;
|
||||||
|
|
||||||
import draylar.omegaconfig.api.Config;
|
import draylar.omegaconfig.api.Config;
|
||||||
|
|
||||||
public class NestedConfig implements Config {
|
public class NestedConfigTest implements Config {
|
||||||
|
|
||||||
public boolean test = false;
|
public boolean test = false;
|
||||||
|
|
||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
package draylar.omegatest;
|
package draylar.omegatest.config;
|
||||||
|
|
||||||
import draylar.omegaconfig.api.Comment;
|
import draylar.omegaconfig.api.Comment;
|
||||||
import draylar.omegaconfig.api.Config;
|
import draylar.omegaconfig.api.Config;
|
||||||
@@ -6,15 +6,15 @@ import draylar.omegaconfig.api.Syncing;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@Syncing
|
@Syncing
|
||||||
public class TestConfig implements Config {
|
public class SimpleConfigTest implements Config {
|
||||||
|
|
||||||
@Comment(value = "Hello!")
|
@Comment(value = "Hello!")
|
||||||
boolean v = false;
|
public boolean v = false;
|
||||||
|
|
||||||
@Comment(value = "I'm a double.")
|
@Comment(value = "I'm a double.")
|
||||||
double doubleTest = 0.0;
|
public double doubleTest = 0.0;
|
||||||
|
|
||||||
String stringTest = "Hello, world!";
|
public String stringTest = "Hello, world!";
|
||||||
|
|
||||||
@Comment(value = "This is an inner static class.")
|
@Comment(value = "This is an inner static class.")
|
||||||
public Test test = new Test();
|
public Test test = new Test();
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package draylar.omegatest;
|
package draylar.omegatest.config;
|
||||||
|
|
||||||
import draylar.omegaconfig.api.Comment;
|
import draylar.omegaconfig.api.Comment;
|
||||||
import draylar.omegaconfig.api.Config;
|
import draylar.omegaconfig.api.Config;
|
||||||
|
|
||||||
public class NewTestConfig implements Config {
|
public class StructuresConfigTest implements Config {
|
||||||
@Comment("Mo' Structures feature toggles.")
|
@Comment("Mo' Structures feature toggles.")
|
||||||
public Features features = new Features();
|
public Features features = new Features();
|
||||||
|
|
||||||
Reference in New Issue
Block a user