Easter cleaning

This commit is contained in:
Willem Cazander 2025-05-07 21:46:32 +02:00
commit 9e36078b2e
1862 changed files with 270281 additions and 0 deletions

View file

@ -0,0 +1,219 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor;
import java.io.StringWriter;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.x4o.sax3.SAX3WriterXml;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8Section;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContentPulser;
import love.distributedrebirth.nx01.warp.manifestor.scopic.iomf5.ScopicManifest5ContentWriter;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天s
public class WarpManifestChinaTest {
@Test
public void testFullChineesium() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeAttribute("", "乞丐歌本").withRemark("同義詞 乞丐歌集");
manifest.makeAttribute("", "一千五百八十一").withRemark("與中國年份時間不同的年份時間");
manifest.makeAttribute("描述", "起司頭押韻詞海盜歌曲歌詞");
WarpManifestX8Section section = null;
section = manifest.makeSection("第一節").withRemark("所以這是一個可選的額外元信息文本");
section.makeAttribute("一號線", "威廉斯·範·納蘇韋").withRemark("章魚有八隻手臂");
section.makeAttribute("二號線", "我是德國血統嗎").withRemark("章魚是海王");
section.makeAttribute("三號線", "忠於祖國").withRemark("你的信來自章魚墨水");
section.makeAttribute("四號線", "我將留下來直到死亡。").withRemark("章魚不知道零");
section.makeAttribute("五號線", "橘子公主").withRemark("算盤有八根卷鬚");
section.makeAttribute("六號線", "我,完全沒有羽毛,").withRemark("還可以用墨菇拼出八個字母");
section.makeAttribute("七號線", "西班牙國王").withRemark("十月是第八個月");
section.makeAttribute("八號線", "我一直很榮幸。").withRemark("這首歌有八行");
section = manifest.makeSection("第二節");
section.withAttribute("一號線", "生活在敬畏神之中");
section.withAttribute("二號線", "我一直觀察到,");
section.withAttribute("三號線", "因此我被趕走,");
section.withAttribute("四號線", "對於土地,對於大聲。");
section.withAttribute("五號線", "但神會統治我");
section.withAttribute("六號線", "就像一件好的樂器一樣,");
section.withAttribute("七號線", "我會回來");
section.withAttribute("八號線", "在我的團裡。");
section = manifest.makeSection("第三節");
section.withAttribute("一號線", "受苦吧,我的臣民");
section.withAttribute("二號線", "那些本性真誠的人,");
section.withAttribute("三號線", "神不會拋棄你,");
section.withAttribute("四號線", "儘管你現在背負著重擔。");
section.withAttribute("五號線", "虔誠地渴望生活的人,");
section.withAttribute("六號線", "日日夜夜向上帝祈禱,");
section.withAttribute("七號線", "他會給我力量,");
section.withAttribute("八號線", "以便我可以幫助你。");
section = manifest.makeSection("第四節");
section.withAttribute("一號線", "身體和靈魂都在一起");
section.withAttribute("二號線", "難道我沒有放過你嗎?");
section.withAttribute("三號線", "我的兄弟們名聲顯赫");
section.withAttribute("四號線", "還向您展示了:");
section.withAttribute("五號線", "阿道夫伯爵留下來");
section.withAttribute("六號線", "在弗里斯蘭的戰鬥中,");
section.withAttribute("七號線", "他的靈魂進入永生");
section.withAttribute("八號線", "預計最後一天。");
section = manifest.makeSection("第五節");
section.withAttribute("一號線", "出身高貴、出身高貴,");
section.withAttribute("二號線", "皇家庫存,");
section.withAttribute("三號線", "被選中的王國王子,");
section.withAttribute("四號線", "作為一個虔誠的基督徒,");
section.withAttribute("五號線", "因神的話而受稱讚,");
section.withAttribute("六號線", "我,毫不畏懼,");
section.withAttribute("七號線", "像英雄一樣無所畏懼");
section.withAttribute("八號線", "我的高貴血統冒了險。");
section = manifest.makeSection("第六節");
section.withAttribute("一號線", "我的盾牌和信心");
section.withAttribute("二號線", "你是我主上帝啊,");
section.withAttribute("三號線", "我想以你為基礎");
section.withAttribute("四號線", "永遠不要再離開我。");
section.withAttribute("五號線", "使我能保持虔誠,");
section.withAttribute("六號線", "你的僕人高於一切,");
section.withAttribute("七號線", "趕走暴政");
section.withAttribute("八號線", "誰傷了我的心。");
section = manifest.makeSection("第七節");
section.withAttribute("一號線", "在所有困擾我的人中");
section.withAttribute("二號線", "迫害我的人是,");
section.withAttribute("三號線", "我的上帝,請保存它");
section.withAttribute("四號線", "你忠實的僕人,");
section.withAttribute("五號線", "他們並不讓我感到驚訝");
section.withAttribute("六號線", "在他們邪惡的勇氣中,");
section.withAttribute("七號線", "不洗手");
section.withAttribute("八號線", "在我無辜的血液裡。");
section = manifest.makeSection("第八節");
section.withAttribute("一號線", "如果大衛不得不逃跑");
section.withAttribute("二號線", "對暴君掃羅來說,");
section.withAttribute("三號線", "所以我不得不嘆息");
section.withAttribute("四號線", "像許多貴族一樣。");
section.withAttribute("五號線", "但神已經高舉他,");
section.withAttribute("六號線", "脫離一切苦難,");
section.withAttribute("七號線", "給予一個王國");
section.withAttribute("八號線", "在以色列非常大。");
section = manifest.makeSection("第九節");
section.withAttribute("一號線", "酸後我會收到");
section.withAttribute("二號線", "來自甜蜜的上帝我的主,");
section.withAttribute("三號線", "讓你嚮往");
section.withAttribute("四號線", "我的皇家思想:");
section.withAttribute("五號線", "也就是說,我可能會死");
section.withAttribute("六號線", "在該領域享有盛譽,");
section.withAttribute("七號線", "獲得永恆的王國");
section.withAttribute("八號線", "就像一個忠誠的英雄。");
section = manifest.makeSection("第十節");
section.withAttribute("一號線", "沒有什麼能讓我再感到遺憾");
section.withAttribute("二號線", "在我的不幸中");
section.withAttribute("三號線", "比人們所看到的貧窮");
section.withAttribute("四號線", "國王的土地很好。");
section.withAttribute("五號線", "你冒犯了西班牙人");
section.withAttribute("六號線", "哦,高貴的荷蘭,親愛的,");
section.withAttribute("七號線", "當我想到這一點時");
section.withAttribute("八號線", "我那顆流血的高貴的心。");
section = manifest.makeSection("第十一節");
section.withAttribute("一號線", "塞得像個王子");
section.withAttribute("二號線", "以我的力量,");
section.withAttribute("三號線", "暴君的");
section.withAttribute("四號線", "我預料到了這一擊");
section.withAttribute("五號線", "他埋葬在馬斯特里赫特附近,");
section.withAttribute("六號線", "害怕我的暴力;");
section.withAttribute("七號線", "有人看到我的騎士在小跑");
section.withAttribute("八號線", "非常勇敢地穿過那個領域。");
section = manifest.makeSection("第十二節");
section.withAttribute("一號線", "這就是主的旨意");
section.withAttribute("二號線", "那時,");
section.withAttribute("三號線", "我很想回頭");
section.withAttribute("四號線", "你很認真地對待這件事。");
section.withAttribute("五號線", "但天上的主,");
section.withAttribute("六號線", "誰主宰萬物,");
section.withAttribute("七號線", "人們應該永遠讚美他,");
section.withAttribute("八號線", "他並不覬覦它。");
section = manifest.makeSection("第十三節");
section.withAttribute("一號線", "他非常信仰基督教");
section.withAttribute("二號線", "我的王子般的心靈,");
section.withAttribute("三號線", "一直堅定不移");
section.withAttribute("四號線", "我的心在逆境中。");
section.withAttribute("五號線", "我已向主祈禱");
section.withAttribute("六號線", "我從心底裡,");
section.withAttribute("七號線", "他會拯救我的事業,");
section.withAttribute("八號線", "可以讓我清白。");
section = manifest.makeSection("第十四節");
section.withAttribute("一號線", "讚美我可憐的羊");
section.withAttribute("二號線", "那些在極大苦難中的人,");
section.withAttribute("三號線", "你的牧羊人不會睡覺,");
section.withAttribute("四號線", "雖然現在你們已經四散了。");
section.withAttribute("五號線", "你將走向上帝,");
section.withAttribute("六號線", "接受祂有益的話語,");
section.withAttribute("七號線", "作為一個虔誠的基督徒生活—");
section.withAttribute("八號線", "很快就到這裡了。");
section = manifest.makeSection("第十五節");
section.withAttribute("一號線", "在神面前我要坦白");
section.withAttribute("二號線", "和他偉大的力量,");
section.withAttribute("三號線", "我會活到那時");
section.withAttribute("四號線", "曾藐視國王,");
section.withAttribute("五號線", "更重要的是我願主上帝,");
section.withAttribute("六號線", "最高陛下,");
section.withAttribute("七號線", "不得不服從");
section.withAttribute("八號線", "在正義中。");
String outputV2 = WarpManifestorDriver.writeV2String(manifest);
Assertions.assertNotNull(outputV2);
String outputIni = WarpManifestorDriver.writeViniString(new WarpManifestX8().withSections(manifest.getSections())); // removes main attributes
Assertions.assertNotNull(outputIni);
byte[] outputV5 = WarpManifestorDriver.writeV5Array(manifest);
Assertions.assertNotNull(outputV5);
WarpManifestX8 manifestV5 = WarpManifestorDriver.readV5Array(outputV5);
StringWriter outputXml = new StringWriter();
SAX3WriterXml writerXml = new SAX3WriterXml(outputXml);
ScopicManifest5ContentWriter writer = new ScopicManifest5ContentWriter(writerXml);
ScopicManifestContentPulser.strobelight(manifestV5, writer, WarpManifestX0TheVersion.VERSION_5_0.getQName());
Assertions.assertTrue(outputXml.toString().contains("<!-- 同義詞 乞丐歌集 -->"));
Assertions.assertTrue(outputXml.toString().contains("<ATTRIBUTE NAME=\"一號線\">威廉斯·範·納蘇韋</ATTRIBUTE>"));
}
}

View file

@ -0,0 +1,79 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18Import;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestorDriverTest {
@Test
public void testWriteSimple() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeAttribute("foo", "bar");
manifest.makeSection("my1").withAttribute("foo1", "bar1");
String output = WarpManifestorDriver.writeV1String(manifest);
Assertions.assertNotNull(output);
Assertions.assertTrue(output.contains("foo1"));
}
@Test
public void testLineWrapAsLastLine() {
String checkWrap = "https://github.com/shrinkwrap/resolver/shrinkwrap-resolver-spi-maven-archive";
String checkWrapLast = "http://www.jboss.org/shrinkwrap-resolver-parent/shrinkwrap-resolver-spi-maven-archive";
WarpManifestX8 manitest = WarpManifestorDriver.readV1Stream(getClass().getResourceAsStream("test-line-wrap.mf"));
Assertions.assertNotNull(manitest);
Assertions.assertEquals(21, manitest.getAttributes().size());
Assertions.assertEquals("Implementation-Title", manitest.getAttributes().get(0).getName());
Assertions.assertEquals(checkWrap, manitest.getAttributeBody("Scm-Url").get());
Assertions.assertEquals(checkWrapLast, manitest.getAttributeBody("Implementation-URL").get());
}
@Test
public void testSizeOfVersions() {
WarpManifestX8 manitest = WarpManifestorDriver.readV1Stream(getClass().getResourceAsStream("test-line-wrap.mf"));
Assertions.assertNotNull(manitest);
WarpManifestX18 manitestX18 = WarpManifestX18Import.fromX8(manitest);
Assertions.assertNotNull(manitestX18);
System.out.println("size-OF: " + manitest.getAttributeBodyNullable("Implementation-Vendor-Id"));
System.out.println("size-V1: " + WarpManifestorDriver.writeV1String(manitest).getBytes(StandardCharsets.UTF_8).length);
System.out.println("size-V2: " + WarpManifestorDriver.writeV2String(manitest).getBytes(StandardCharsets.UTF_8).length);
System.out.println("size-V3: " + WarpManifestorDriver.writeV3Array(manitest).length);
System.out.println("size-V4: " + WarpManifestorDriver.writeV4Array(manitestX18).length);
System.out.println("size-V5: " + WarpManifestorDriver.writeV5Array(manitest).length);
}
}

View file

@ -0,0 +1,138 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestorVIniTest {
@Test
public void testViniReadSystemdService() {
WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-ntp.service"));
Assertions.assertNotNull(manitest);
Assertions.assertEquals(3, manitest.getSections().size());
Assertions.assertEquals("Network Time Service", manitest.getSectionAttributeBodyNullable("Unit", "Description"));
Assertions.assertEquals("man:ntpd(8)", manitest.getSectionAttributeBodyNullable("Unit", "Documentation"));
//System.out.println(WarpManifestorDriver.writeViniString(manitest));
}
@Test
public void testViniReadSimple() {
WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-simple.ini"));
Assertions.assertNotNull(manitest);
Assertions.assertEquals(3, manitest.getSections().size());
Assertions.assertEquals("last modified 1 April 2001 by John Doe", manitest.getSection("owner").get().getRemarks().get(0));
Assertions.assertEquals("John Doe", manitest.getSectionAttributeBodyNullable("owner", "name"));
Assertions.assertEquals("Acme Widgets Inc.", manitest.getSectionAttributeBodyNullable("owner", "organization"));
Assertions.assertEquals("192.0.2.62", manitest.getSectionAttributeBodyNullable("database", "server"));
Assertions.assertEquals("143", manitest.getSectionAttributeBodyNullable("database", "port"));
Assertions.assertEquals("payroll.dat", manitest.getSectionAttributeBodyNullable("database", "file"));
Assertions.assertEquals("use IP address in case network name resolution is not working", manitest.getSectionAttribute("database", "server").get().getRemarks().get(0));
Assertions.assertEquals("key=v", manitest.getSectionAttributeBodyNullable("keys", "key"));
Assertions.assertEquals("value", manitest.getSectionAttributeBodyNullable("keys", "name"));
Assertions.assertEquals(";", manitest.getSectionAttributeBodyNullable("keys", "sem"));
Assertions.assertEquals("v5822.433.2", manitest.getSectionAttributeBodyNullable("keys", "semver"));
}
@Test
public void testViniReadFruitFolding() {
WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini"));
Assertions.assertNotNull(manitest);
Assertions.assertEquals(6, manitest.getSections().size());
Assertions.assertEquals("orchard rental service (with app)", manitest.getSectionAttributeBodyNullable("project", "name"));
Assertions.assertEquals("Bay Area", manitest.getSectionAttributeBodyNullable("project", "target region"));
Assertions.assertEquals("(vacant)", manitest.getSectionAttributeBodyNullable("project", "legal team"));
Assertions.assertEquals("TODO: advertise vacant positions", manitest.getSectionAttribute("project", "legal team").get().getRemarks().get(0));
Assertions.assertEquals("foreseeable", manitest.getSectionAttributeBodyNullable("fruit \"Apple\"", "trademark issues"));
Assertions.assertEquals("known", manitest.getSectionAttributeBodyNullable("fruit \"Apple\"", "taste"));
Assertions.assertEquals("logistics (fragile fruit)", manitest.getSectionAttributeBodyNullable("fruit \"Raspberry\"", "anticipated problems"));
Assertions.assertEquals("possible", manitest.getSectionAttributeBodyNullable("fruit \"Raspberry\"", "Trademark Issues"));
Assertions.assertEquals("2021-11-23, 08:54 +0900", manitest.getSectionAttributeBodyNullable("fruit.raspberry.proponents.fred", "date"));
Assertions.assertEquals("I like red fruit.", manitest.getSectionAttributeBodyNullable("fruit.raspberry.proponents.fred", "comment"));
Assertions.assertEquals("Why,I would buy dates.", manitest.getSectionAttributeBodyNullable("fruit \"Date/proponents/alfred\"", "comment"));
Assertions.assertEquals("My name may contain a \nnewline.", manitest.getSectionAttributeBodyNullable("fruit \"Date/proponents/alfred\"", "editor"));
}
@Test
public void testViniWriteFruitFolding() {
WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini"));
Assertions.assertNotNull(manitest);
String strini = WarpManifestorDriver.writeViniString(manitest);
Assertions.assertTrue(strini.contains("target region = Bay Area"));
Assertions.assertTrue(strini.contains("# TODO: advertise vacant positions"));
Assertions.assertTrue(strini.contains("Trademark Issues = truly unlikely"));
Assertions.assertTrue(strini.contains("Trademark Issues = possible"));
Assertions.assertTrue(strini.contains("comment = I like red fruit."));
Assertions.assertTrue(strini.contains("comment = Why,I would buy dates."));
Assertions.assertTrue(strini.contains("editor = My name may contain a \\nnewline."));
}
@Test
public void testViniReadEscQuote() {
WarpManifestX8 manitest = WarpManifestorDriver.readViniStream(getClass().getResourceAsStream("ini/test-esc-quote.ini"));
Assertions.assertNotNull(manitest);
Assertions.assertEquals(3, manitest.getSections().size());
Assertions.assertEquals("'Junit'", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_single"));
Assertions.assertEquals("Junit\'s hell0", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_single_center"));
Assertions.assertEquals("Junit\'", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_single_right"));
Assertions.assertEquals("\'Junit", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_single_left"));
Assertions.assertEquals("\"Junit\"", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_double"));
Assertions.assertEquals("Junit\"s hell0", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_double_center"));
Assertions.assertEquals("Junit\"", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_double_right"));
Assertions.assertEquals("\"Junit", manitest.getSectionAttributeBodyNullable("EscQuote", "quote_double_left"));
Assertions.assertEquals("Junit\thell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "tab"));
Assertions.assertEquals("Junit\\hell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "backslash"));
Assertions.assertEquals("Junit\nhell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "line_feed"));
Assertions.assertEquals("Junit\rhell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "carriage_return"));
Assertions.assertEquals("Junit\0hell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "null_character"));
Assertions.assertEquals("Junit\bhell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "backspace"));
Assertions.assertEquals("Junit\fhell0", manitest.getSectionAttributeBodyNullable("EscCharNative", "form_feed"));
Assertions.assertEquals("Junit;hell0", manitest.getSectionAttributeBodyNullable("EscCharOther", "semicolon"));
Assertions.assertEquals("Junit#hell0", manitest.getSectionAttributeBodyNullable("EscCharOther", "number_sign"));
Assertions.assertEquals("Junit=hell0", manitest.getSectionAttributeBodyNullable("EscCharOther", "equals_sign"));
Assertions.assertEquals("Junit:hell0", manitest.getSectionAttributeBodyNullable("EscCharOther", "colon"));
Assertions.assertEquals("str1;str2;str3", manitest.getSectionAttributeBodyNullable("EscCharOther", "quote_semi_colons"));
}
}

View file

@ -0,0 +1,96 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestBigBodyTest {
@Test
public void testWriteV1LongContent() {
StringBuilder buf = new StringBuilder();
for (int i=0;i<512;i++) {
buf.append("1234");
}
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("long-longer-longggger", buf.toString());
String output = WarpManifestorDriver.writeV1String(manifest);
Assertions.assertNotNull(output);
String lines[] = output.split("\n");
Assertions.assertEquals(31, lines.length);
Assertions.assertEquals(72, lines[10].length());
Assertions.assertEquals(72, lines[11].getBytes(StandardCharsets.UTF_8).length);
}
@Test
public void testWriteV2LongContent() {
StringBuilder buf = new StringBuilder();
for (int i=0;i<512;i++) {
buf.append("1234");
}
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("long-longer-longggger", buf.toString());
String output = WarpManifestorDriver.writeV2String(manifest);
Assertions.assertNotNull(output);
String lines[] = output.split("\n");
Assertions.assertEquals(2, lines.length);
Assertions.assertEquals(21, lines[0].length());
Assertions.assertEquals(2071, lines[1].getBytes(StandardCharsets.UTF_8).length);
String outputV1 = WarpManifestorDriver.writeV1String(manifest);
WarpManifestX8 manitestV1 = WarpManifestorDriver.readV2String(outputV1);
Assertions.assertNotNull(manitestV1);
Assertions.assertEquals(1, manitestV1.getAttributes().size());
}
@Test
public void testWriteV3LongContent() {
StringBuilder buf = new StringBuilder();
for (int i=0;i<65535;i++) {
buf.append("0");
}
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("limit-lines", buf.toString());
byte[] output = WarpManifestorDriver.writeV3Array(manifest);
Assertions.assertNotNull(output);
WarpManifestX8 manifestClone = WarpManifestorDriver.readV3Array(output);
Assertions.assertEquals(manifest.getAttributes().get(0).getBody(), manifestClone.getAttributes().get(0).getBody());
Assertions.assertThrows(ScopicManifestException.class, () -> {
manifest.withAttribute("limit-lines", "1" + buf.toString());
WarpManifestorDriver.writeV3Array(manifest);
});
}
}

View file

@ -0,0 +1,120 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestBodyIllegalTest {
@Test
public void testWriteV1BodyNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\n");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV1BodyLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\r");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV1BodyNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\u0000");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2BodyNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\n");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV2BodyLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\r");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV2BodyNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\u0000");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV3BodyNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\n");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV3BodyLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\r");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV3BodyNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar\u0000");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
}

View file

@ -0,0 +1,179 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestNameDupTest {
@Test
public void testWriteV1DuplicateMainAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar1");
manifest.withAttribute("foo", "bar2");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV1DuplicateSection() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit");
manifest.makeSection("junit");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV1DuplicateSectionAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2DuplicateMainAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar1");
manifest.withAttribute("foo", "bar2");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV2DuplicateSection() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit");
manifest.makeSection("junit");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV2DuplicateSectionAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV3DuplicateMainAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "bar1");
manifest.withAttribute("foo", "bar2");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV3DuplicateSection() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit");
manifest.makeSection("junit");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV3DuplicateSectionAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV4DuplicateMainAttribute() {
WarpManifestX18 manifest = new WarpManifestX18();
manifest.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
manifest.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV4Array(manifest);
});
}
@Test
public void testWriteV4DuplicateSection() {
WarpManifestX18 manifest = new WarpManifestX18();
manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV4Array(manifest);
});
}
@Test
public void testWriteV4DuplicateSectionAttribute() {
WarpManifestX18 manifest = new WarpManifestX18();
manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)))
.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)))
.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV4Array(manifest);
});
}
@Test
public void testWriteV5DuplicateSection() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit");
manifest.makeSection("junit");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
@Test
public void testWriteV5DuplicateSectionAttribute() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
}

View file

@ -0,0 +1,87 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestNameEmptyTest {
@Test
public void testWriteV1NameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2NameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV3NameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV4NameEmpty() {
WarpManifestX18 manifest = new WarpManifestX18();
manifest.withAttribute(PrimordialOctalOrangeString.valueOfEmpty(), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(12,34)));
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV4Array(manifest);
});
}
@Test
public void testWriteV5NameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
}

View file

@ -0,0 +1,147 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestNameForbidCharTest {
@Test
public void testWriteV1NameNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\n", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV1NameLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\r", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV1NameNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\u0000", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2NameNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\n", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV2NameLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\r", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV2NameNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\u0000", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV3NameNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\n", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV3NameLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\r", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV3NameNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\u0000", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV5NameNewLine() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\n", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
@Test
public void testWriteV5NameLineFeed() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\r", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
@Test
public void testWriteV5NameNull() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo\u0000", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
}

View file

@ -0,0 +1,88 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestNameLimitTest {
@Test
public void testWriteV1NameLimit() {
StringBuilder buf = new StringBuilder();
for (int i=0;i<70;i++) {
buf.append("0");
}
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute(buf.toString(), "foo");
WarpManifestorDriver.writeV1String(manifest);
Assertions.assertThrows(ScopicManifestException.class, () -> {
manifest.withAttribute(buf.toString() + "1", "bar");
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2NameLimit() {
StringBuilder buf = new StringBuilder();
for (int i=0;i<65535;i++) {
buf.append("0");
}
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeAttribute(buf.toString(), "foo").withRemark("remarkable");
String output = WarpManifestorDriver.writeV2String(manifest);
Assertions.assertNotNull(output);
Assertions.assertTrue(output.contains("foo"));
Assertions.assertTrue(output.contains("remarkable"));
Assertions.assertThrows(ScopicManifestException.class, () -> {
manifest.withAttribute(buf.toString() + "1", "bar");
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV3NameLimit() {
StringBuilder buf = new StringBuilder();
for (int i=0;i<65535;i++) {
buf.append("0");
}
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeAttribute(buf.toString(), "foo").withRemark("remarkable");
byte[] output = WarpManifestorDriver.writeV3Array(manifest);
Assertions.assertNotNull(output);
Assertions.assertThrows(ScopicManifestException.class, () -> {
manifest.withAttribute(buf.toString() + "1", "bar");
WarpManifestorDriver.writeV3Array(manifest);
});
}
}

View file

@ -0,0 +1,84 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestNameSeperatorTest {
@Test
public void testWriteV1NameSeperator() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo:", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2OutputSeperator() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("ju n it:", "junit:");
String output = WarpManifestorDriver.writeV2String(manifest);
Assertions.assertNotNull(output);
Assertions.assertTrue(output.contains("ju&#x20;n&#x20;it&#x3A;:"));
Assertions.assertTrue(output.contains("junit:"));
}
@Test
public void testWriteV3OutputSeperator() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("ju n it:", "junit:");
byte[] output = WarpManifestorDriver.writeV3Array(manifest);
Assertions.assertNotNull(output);
WarpManifestX8 manitest = WarpManifestorDriver.readV3Array(output);
Assertions.assertNotNull(manitest);
Assertions.assertEquals(1, manitest.getAttributes().size());
Assertions.assertEquals("ju n it:", manitest.getAttributes().get(0).getName());
Assertions.assertEquals("junit:", manitest.getAttributes().get(0).getBody());
}
@Test
public void testWriteV5OutputSeperator() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("ju n it:", "junit:");
byte[] output = WarpManifestorDriver.writeV5Array(manifest);
Assertions.assertNotNull(output);
WarpManifestX8 manitest = WarpManifestorDriver.readV5Array(output);
Assertions.assertNotNull(manitest);
Assertions.assertEquals(1, manitest.getAttributes().size());
Assertions.assertEquals("ju n it:", manitest.getAttributes().get(0).getName());
Assertions.assertEquals("junit:", manitest.getAttributes().get(0).getBody());
}
}

View file

@ -0,0 +1,101 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestNameUnicodeTest {
@Test
public void testWriteV1NameUnicode() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "仙上主天");
WarpManifestorDriver.writeV1String(manifest);
Assertions.assertThrows(ScopicManifestException.class, () -> {
manifest.withAttribute("仙上主天", "bar");
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2NameUnicode() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "仙上主天");
manifest.withAttribute("仙上主天", "bar");
String output = WarpManifestorDriver.writeV2String(manifest);
Assertions.assertNotNull(output);
String lines[] = output.split("\n");
Assertions.assertEquals(3, lines.length);
Assertions.assertEquals("foo: 仙上主天", lines[1]);
Assertions.assertEquals("&#x4ED9;&#x4E0A;&#x4E3B;&#x5929;: bar", lines[2]);
WarpManifestX8 manitest = WarpManifestorDriver.readV2String(output);
Assertions.assertNotNull(manitest);
Assertions.assertEquals(2, manitest.getAttributes().size());
Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName());
Assertions.assertEquals("仙上主天", manitest.getAttributes().get(1).getName());
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.readV1String(output);
});
}
@Test
public void testWriteV3NameUnicode() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "仙上主天");
manifest.withAttribute("仙上主天", "bar");
byte[] output = WarpManifestorDriver.writeV3Array(manifest);
Assertions.assertNotNull(output);
WarpManifestX8 manitest = WarpManifestorDriver.readV3Array(output);
Assertions.assertNotNull(manitest);
Assertions.assertEquals(2, manitest.getAttributes().size());
Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName());
Assertions.assertEquals("仙上主天", manitest.getAttributes().get(1).getName());
}
@Test
public void testWriteV5NameUnicode() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.withAttribute("foo", "仙上主天");
manifest.withAttribute("仙上主天", "bar");
byte[] output = WarpManifestorDriver.writeV5Array(manifest);
Assertions.assertNotNull(output);
WarpManifestX8 manitest = WarpManifestorDriver.readV5Array(output);
Assertions.assertNotNull(manitest);
Assertions.assertEquals(2, manitest.getAttributes().size());
Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName());
Assertions.assertEquals("仙上主天", manitest.getAttributes().get(1).getName());
}
}

View file

@ -0,0 +1,88 @@
/*
* 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 love.distributedrebirth.nx01.warp.manifestor.manifest;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public class WarpManifestSectionNameEmptyTest {
@Test
public void testWriteV1SectionNameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("").withAttribute("foo", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV1String(manifest);
});
}
@Test
public void testWriteV2SectionNameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("").withAttribute("foo", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV2String(manifest);
});
}
@Test
public void testWriteV3SectionNameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("").withAttribute("foo", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV3Array(manifest);
});
}
@Test
public void testWriteV4SectionNameEmpty() {
PrimordialOctalOrangeString foobar = PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(123,456,789));
WarpManifestX18 manifest = new WarpManifestX18();
manifest.makeSection(PrimordialOctalOrangeString.valueOfEmpty()).withAttribute(foobar, foobar);
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV4Array(manifest);
});
}
@Test
public void testWriteV5SectionNameEmpty() {
WarpManifestX8 manifest = new WarpManifestX8();
manifest.makeSection("").withAttribute("foo", "bar");
Assertions.assertThrows(ScopicManifestException.class, () -> {
WarpManifestorDriver.writeV5Array(manifest);
});
}
}

View file

@ -0,0 +1,25 @@
[EscQuote]
quote_single=\'Junit\'
quote_single_center="Junit\'s hell0"
quote_single_right=Junit'
quote_single_left='Junit
quote_double=\"Junit\"
quote_double_center="Junit\"s hell0"
quote_double_right=Junit"
quote_double_left="Junit
[EscCharNative]
tab="Junit\thell0"
backslash="Junit\\hell0"
line_feed="Junit\nhell0"
carriage_return="Junit\rhell0"
null_character="Junit\0hell0"
backspace="Junit\bhell0"
form_feed="Junit\fhell0"
[EscCharOther]
semicolon="Junit\;hell0"
number_sign="Junit\#hell0"
equals_sign="Junit\=hell0"
colon="Junit\:hell0"
quote_semi_colons=str1\;str2\;str3

View file

@ -0,0 +1,31 @@
[project]
name = orchard rental service (with app)
target region = "Bay Area"
; TODO: advertise vacant positions
legal team = (vacant)
[fruit "Apple"]
trademark issues = foreseeable
taste = known
[fruit.Date]
taste = novel
Trademark Issues="truly unlikely"
[fruit "Raspberry"]
anticipated problems ="logistics (fragile fruit)"
Trademark Issues=\
possible
[fruit.raspberry.proponents.fred]
date = 2021-11-23, 08:54 +0900
comment = "I like red fruit."
[fruit "Date/proponents/alfred"]
comment: Why, \
\
\
I would buy dates.
# folding: Is "\\\\\nn" interpreted as "\\n" or "\n"?
# Or does "\\\\" prevent folding?
editor =My name may contain a \\
newline.

View file

@ -0,0 +1,23 @@
[Unit]
Description=Network Time Service
Documentation=man:ntpd(8)
Wants=network.target
ConditionCapability=CAP_SYS_TIME
After=network.target nss-lookup.target
Conflicts=systemd-timesyncd.service
[Service]
Type=forking
PrivateTmp=true
PIDFile=/run/ntpd.pid
ExecStart=/usr/libexec/ntpsec/ntp-systemd-wrapper
# Specifying -g on the command line allows ntpd to make large adjustments to
# the clock on boot. However, if Restart=yes is set, a malicious (or broken)
# server could send the incorrect time, trip the panic threshold, and when
# ntpd restarts, serve it the incorrect time (which would be accepted).
Restart=no
[Install]
Alias=ntp.service
Alias=ntpd.service
WantedBy=multi-user.target

View file

@ -0,0 +1,16 @@
; last modified 1 April 2001 by John Doe
[owner]
name = John Doe
organization = Acme Widgets Inc.
[database]
; use IP address in case network name resolution is not working
server = 192.0.2.62
port = 143
file = "payroll.dat"
[keys]
key=key=v
name =value
sem=;
semver=v5822.433.2

View file

@ -0,0 +1,26 @@
Manifest-Version: 1.0
Implementation-Title: ShrinkWrap Resolver Maven Archive SPI
Implementation-Version: 2.2.6
Build-Timestamp: Thu, 26 Jan 2017 16:26:41 +0000
Archiver-Version: Plexus Archiver
Java-Version: 1.8.0_101
Built-By: mjobanek
Scm-Connection: scm:git:git://github.com/shrinkwrap/resolver.git/shrin
kwrap-resolver-spi-maven-archive
Specification-Vendor: JBoss by Red Hat
Os-Arch: amd64
Specification-Title: ShrinkWrap Resolver Maven Archive SPI
Implementation-Vendor-Id: org.jboss.shrinkwrap.resolver
Java-Vendor: Oracle Corporation
Os-Name: Linux
Scm-Url: https://github.com/shrinkwrap/resolver/shrinkwrap-resolver-sp
i-maven-archive
Implementation-Vendor: JBoss by Red Hat
Os-Version: 4.8.15-200.fc24.x86_64
Scm-Revision: 773ec70bd9e470e43dc452f5d6696b5091fc483c
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_101
Specification-Version: 2.2.6
Implementation-URL: http://www.jboss.org/shrinkwrap-resolver-parent/sh
rinkwrap-resolver-spi-maven-archive