gdxapp4d/gdxapp4d-lib-unicodezd/src/test/java/love/distributedrebirth/unicode4d/CodePointTest.java

56 lines
2.1 KiB
Java
Raw Normal View History

2022-03-18 01:10:02 +00:00
package love.distributedrebirth.unicode4d;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
2022-10-20 01:06:56 +00:00
import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.numberxd.base2t.part.T002PartBinary;
2022-03-18 01:10:02 +00:00
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
2022-10-15 00:34:58 +00:00
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
2022-03-18 01:10:02 +00:00
public class CodePointTest {
@Test
public void testCommand() {
V036Teger teger = new V036Teger();
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_1, 0);
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_2, 12345);
2022-03-18 01:10:02 +00:00
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_1);
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_2);
2022-03-18 01:10:02 +00:00
Assertions.assertEquals(0, value1);
Assertions.assertEquals(12345, value2);
}
}
@Test
public void testNegativeArguments() {
V036Teger teger = new V036Teger();
for (int i=-16384;i<16384;i++) {
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_1, i);
CodePointᶻᴰ.INSTANCE.setArgument(teger, T002PartBinary.PART_2, i);
2022-03-18 01:10:02 +00:00
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
int value1 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_1);
int value2 = CodePointᶻᴰ.INSTANCE.getArgument(teger, T002PartBinary.PART_2);
2022-03-18 01:10:02 +00:00
Assertions.assertEquals(i, value1);
Assertions.assertEquals(i, value2);
}
}
}
@Test
public void testUnicode() {
V036Teger teger = new V036Teger();
for (int i=0;i<244000;i++) {
for (CodePointCommandᶻᴰ cmd:CodePointCommandᶻᴰ.values()) {
CodePointᶻᴰ.INSTANCE.setArgumentUnicode(teger, i);
CodePointᶻᴰ.INSTANCE.setCommand(teger, cmd);
int value = CodePointᶻᴰ.INSTANCE.getArgumentUnicode(teger);
Assertions.assertEquals(i, value);
}
}
}
}