nx01/nx01-jpp-base/src/test/java/ᒢᐩᐩ/ᒡᒢᑊᒻᒻᓫᔿ/ᣳᣝᐤᣜᣳ/ᒢᓫᑊᐣᑊ/HinaryTest.java
Willem 806121a09a
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 1m11s
JPP: Concerted zerdinal to long
2026-02-01 17:22:47 +01:00

145 lines
7 KiB
Java

/*
* Copyright ©Δ∞ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T003ᖟ;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.T512ᖟ;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.ᕐᓑᣕᔆ.T008ᖟGun.T008ᖟGunHinarī;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.ᕐᓑᣕᔆ.T008ᖟGun.T008ᖟGunHinarīSupplement6;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.ᕐᓑᣕᔆ.T008ᖟGun.T008ᖟGunHinarīSupplement9;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V018Tord;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class HinaryTest {
@Test
public void testHinaryOrder() {
Map<Long, String> refMap = new HashMap<>();
List<String> refSort = new ArrayList<>();
for (T512ᖟ value : T512ᖟ.values()) {
StringBuilder buf = new StringBuilder();
buf.append(">");
buf.append(value.clampᐧtuneᐧby3(T003ᖟ.PART_1).abacusRȧñkGunFire(T008ᖟGunHinarī.class));
buf.append(value.clampᐧtuneᐧby3(T003ᖟ.PART_2).abacusRȧñkGunFire(T008ᖟGunHinarīSupplement6.class));
buf.append(value.clampᐧtuneᐧby3(T003ᖟ.PART_3).abacusRȧñkGunFire(T008ᖟGunHinarīSupplement9.class));
buf.append("<");
refMap.put(value.zerdinal(), buf.toString());
refSort.add(buf.toString());
}
Collections.shuffle(refSort); // optional for this test
Collections.sort(refSort);
Assertions.assertEquals(refMap.get(0L), refSort.get(0));
Assertions.assertEquals(refMap.get(1L), refSort.get(1));
for (T512ᖟ value : T512ᖟ.values()) {
Assertions.assertEquals(refMap.get(value.zerdinal()), refSort.get((int) value.zerdinal()));
}
}
// @Test
// public void testHinaryUnicodeOrdered() {
// List<String> codes = new ArrayList<>();
// for (T008ᖟ value : T008ᖟ.values()) {
// codes.add(value.abacusRȧñkGunFire(T008ᖟGunHinarī.class));
// }
// Collections.sort(codes);
// StringBuilder buf = new StringBuilder();
// for (String code : codes) {
// buf.append("\\u");
// buf.append(String.format("%04X", 0 + code.charAt(0)));
// }
// System.out.println("VALUES = \"" + buf.toString() + "\"");
// }
@Test
public void testToHinari() {
StringBuilder buf3 = new StringBuilder();
StringBuilder buf6 = new StringBuilder();
StringBuilder buf9 = new StringBuilder();
// MIN + MAX + immortal + highest + lord + heaven
int[] vv = new int[] {0,262143,22270,21100,00104,10430};
for (int v:vv) {
V018Tord tord = new V018Tord();
tord.smurfᐧnativeᐧint(v);
tord.gearᐧtoᐧhinarīᐧχ3(buf3);
tord.gearᐧtoᐧhinarīᐧχ6(buf6);
tord.gearᐧtoᐧhinarīᐧχ9(buf9);
}
Assertions.assertEquals("דדדדדדײײײײײײדװייײױדװווװרדדדודרדזרזײױ", buf3.toString());
Assertions.assertEquals("דְדְדְײֽײֽײֽדַיֵײֻדַוֲװֶדְדֲדֶדֳרֳײֻ", buf6.toString());
Assertions.assertEquals("דְ֔דְ֔ײֽ֩ײֽ֩דַ֝יֽ֠דַ֕וַ֞דְ֔וְ֞דֳ֞זֽ֠", buf9.toString());
}
@Test
public void testAsHinari() {
List<V018Tord> tordsX3 = V018Tord..gearsᐧbuildᐧbricksᐧfromᐧhinarī("דדדדדדײײײײײײדװייײױדװווװרדדדודרדזרזײױ");
List<V018Tord> tordsX6 = V018Tord..gearsᐧbuildᐧbricksᐧfromᐧhinarī("דְדְדְײֽײֽײֽדַיֵײֻדַוֲװֶדְדֲדֶדֳרֳײֻ");
List<V018Tord> tordsX9 = V018Tord..gearsᐧbuildᐧbricksᐧfromᐧhinarī("דְ֔דְ֔ײֽ֩ײֽ֩דַ֝יֽ֠דַ֕וַ֞דְ֔וְ֞דֳ֞זֽ֠");
List<V018Tord> tordsOrg = new ArrayList<>();
// MIN + MAX + immortal + highest + lord + heaven
int[] vv = new int[] {0,262143,22270,21100,00104,10430};
for (int v:vv) {
V018Tord tord = new V018Tord();
tord.smurfᐧnativeᐧint(v);
tordsOrg.add(tord);
}
Assertions.assertEquals(tordsOrg.size(), tordsX3.size());
Assertions.assertEquals(tordsOrg.size(), tordsX6.size());
Assertions.assertEquals(tordsOrg.size(), tordsX9.size());
for (int i=0;i<tordsOrg.size();i++) {
V018Tord tordOrg = tordsOrg.get(i);
Assertions.assertEquals(tordOrg.smurfᐧnativeᐧint(), tordsX3.get(i).smurfᐧnativeᐧint());
Assertions.assertEquals(tordOrg.smurfᐧnativeᐧint(), tordsX6.get(i).smurfᐧnativeᐧint());
Assertions.assertEquals(tordOrg.smurfᐧnativeᐧint(), tordsX9.get(i).smurfᐧnativeᐧint());
}
}
@Test
public void testToHinariOrder() throws Exception {
V018Tord word = new V018Tord();
word.smurfᐧnativeᐧint(0);
Assertions.assertEquals("דְ֔דְ֔", word.gearᐧtoᐧhinarīᐧχ9());
word.smurfᐧnativeᐧint(262143); // max
Assertions.assertEquals("ײֽ֩ײֽ֩", word.gearᐧtoᐧhinarīᐧχ9());
word.smurfᐧnativeᐧint(22270); // immortals
Assertions.assertEquals("דַ֝יֽ֠", word.gearᐧtoᐧhinarīᐧχ9());
}
}