FC18: Added failing unit test to fix some time later when need it work
This commit is contained in:
parent
e1d804b168
commit
dc0f9b2282
2 changed files with 137 additions and 43 deletions
|
|
@ -22,6 +22,11 @@
|
|||
*/
|
||||
package org.x4o.fc18.zion7;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -29,7 +34,9 @@ import java.util.List;
|
|||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.x4o.fc18.FourCornerUnicodeDisplay;
|
||||
import org.x4o.fc18.cake2.flag4.FCDotF4TTY0001DashNL;
|
||||
import org.x4o.fc18.octal8.PrimordialOctal;
|
||||
import org.x4o.fc18.octal8.PrimordialOctalOrangeString;
|
||||
|
||||
/**
|
||||
* Tests four corner grapher parts.
|
||||
|
|
@ -73,6 +80,35 @@ public class StenoGrapherTest {
|
|||
Assertions.assertEquals("¹/₁₂₃¹/₁₂₃₄₅", resX06);
|
||||
}
|
||||
|
||||
//Test TODO: MOVE + fix java.io.IOException: Expected 9 bytes, got: 3 from PrimordialOctalOrangeString.ioSmurfReadStreamX8
|
||||
public void testNCRWriteFile() throws Exception {
|
||||
File testFile = new File("target/test-ncr.dat");
|
||||
try (OutputStream out = new FileOutputStream(testFile)) {
|
||||
//FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18PackedX8(out);
|
||||
List<Integer> outX18 = new ArrayList<>();
|
||||
FourCornerZion7Candlelier writerX18 = FourCornerZionStenoGrapher.writerX18(outX18);
|
||||
writerX18.strobeDocumentAlpha();
|
||||
for (int x = 1; x <= 1025 /*_999999*/; x++) {
|
||||
BigInteger v = BigInteger.valueOf(x);
|
||||
writerX18.strobeNCR1632(BigInteger.ONE, v);
|
||||
writerX18.strobeWord(FCDotF4TTY0001DashNL.NETHER_LINE.cakePointDotIndex());
|
||||
}
|
||||
writerX18.strobeDocumentOmega();
|
||||
PrimordialOctalOrangeString str = PrimordialOctalOrangeString.ioSmurfReadListX18(outX18);
|
||||
PrimordialOctalOrangeString.ioSmurfWriteStreamX8(out, str);
|
||||
}
|
||||
// todo test streaming read too
|
||||
try (InputStream in = new FileInputStream(testFile)) {
|
||||
PrimordialOctalOrangeString str = PrimordialOctalOrangeString.ioSmurfReadStreamX8(in);
|
||||
List<Integer> testX18 = new ArrayList<>();
|
||||
PrimordialOctalOrangeString.ioSmurfWriteListX18(testX18, str);
|
||||
String fileStr = FourCornerUnicodeDisplay.text().renderFromInt18(testX18);
|
||||
//System.out.println(fileStr);
|
||||
Assertions.assertFalse(fileStr.contains("burnNCR1632MissingBankSparkler"), "data error");
|
||||
}
|
||||
//testFile.delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNCRCount1024() throws Exception {
|
||||
List<Integer> outX06 = new ArrayList<>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue