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-30 15:59:24 +00:00
|
|
|
|
import love.distributedrebirth.bassboon.jpp.lang.babel.duyts.DuytsDocAuthor注;
|
2022-10-25 13:09:02 +00:00
|
|
|
|
import love.distributedrebirth.numberxd.base2t.part.T002PartBinary;
|
2022-03-18 01:10:02 +00:00
|
|
|
|
import love.distributedrebirth.numberxd.base2t.type.V036Teger;
|
|
|
|
|
|
2022-10-30 15:59:24 +00:00
|
|
|
|
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-03-18 01:10:02 +00:00
|
|
|
|
public class CodePointTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testCommand() {
|
|
|
|
|
V036Teger teger = new V036Teger();
|
2022-10-25 13:09:02 +00:00
|
|
|
|
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);
|
2022-10-25 13:09:02 +00:00
|
|
|
|
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()) {
|
2022-10-25 13:09:02 +00:00
|
|
|
|
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);
|
2022-10-25 13:09:02 +00:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|