FC18: Added auto escape for FC6_PLUS steno tongue dialect

This commit is contained in:
Willem Cazander 2025-09-06 20:28:43 +02:00
parent 53b9db8319
commit f7b80957fb
5 changed files with 164 additions and 30 deletions

View file

@ -29,6 +29,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.junit.jupiter.api.Assertions;
@ -47,6 +48,32 @@ import org.x4o.fc18.zion7.flame4.FCFlameNumberTaste;
*/
public class StenoGrapherTest {
@Test
public void testStenoTongueLimits() throws Exception {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
FourCornerZionStenoGrapher.writerX06(new ArrayList<>()).strobeTheWord(0x040000);
});
Assertions.assertThrows(IllegalArgumentException.class, () -> {
FourCornerZionStenoGrapher.writerX18(new ArrayList<>()).strobeTheWord(0x040000);
});
}
@Test
public void testStenoAutoFC6Plus() throws Exception {
List<Integer> out = new ArrayList<>();
FourCornerZion7Bereshit writerFC06 = FourCornerZionStenoGrapher.writerX06(out);
writerFC06.strobeTheWord(0x00012D);
Assertions.assertEquals(5, out.size());
Iterator<Integer> outTest = out.iterator();
Assertions.assertEquals(2, outTest.next());
Assertions.assertEquals(2, outTest.next());
Assertions.assertEquals(2, outTest.next());
Assertions.assertEquals(27, outTest.next());
Assertions.assertEquals(37, outTest.next());
String res = FourCornerUnicodeDisplay.text().renderFromInt18(out);
Assertions.assertEquals("0", res);
}
@Test
public void testSandWorm() throws Exception {
List<Integer> out = new ArrayList<>();