From fa6ad9fcc1a2dcc0f77295d43ff865705e9f1008 Mon Sep 17 00:00:00 2001 From: Willem Date: Tue, 7 Jan 2025 20:42:45 +0100 Subject: [PATCH] Used magic values in PI number encoding test --- .../fc18/FourCornerUnicodeDisplayTest.java | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/nx01-x4o-o2o/src/test/java/org/x4o/o2o/fc18/FourCornerUnicodeDisplayTest.java b/nx01-x4o-o2o/src/test/java/org/x4o/o2o/fc18/FourCornerUnicodeDisplayTest.java index ac3e4f2..a8aebae 100644 --- a/nx01-x4o-o2o/src/test/java/org/x4o/o2o/fc18/FourCornerUnicodeDisplayTest.java +++ b/nx01-x4o-o2o/src/test/java/org/x4o/o2o/fc18/FourCornerUnicodeDisplayTest.java @@ -42,32 +42,31 @@ public class FourCornerUnicodeDisplayTest { @Test public void testPINSimple() throws Exception { List cdc = new ArrayList<>(); - cdc.add(FCDotCDC1604DashP6.NX24_X); // = X + cdc.add(FCDotCDC1604DashP6.NX24_X); // = X + cdc.add(FCDotCDC1604DashP6._EQUALS); cdc.add(FCDotCDC1604DashP6.__PIN); - cdc.add(FCDotCDC1604DashP6.NX03_C); // T003 - cdc.add(FCDotCDC1604DashP6.NX01_A); // NXX_001 + cdc.add(FCDotCDC1604DashP6.NX15_O); // T015 + cdc.add(FCDotCDC1604DashP6.NX14_N); // NXX_015 + cdc.add(FCDotCDC1604DashP6.NX05_E); // NXX_005 + cdc.add(FCDotCDC1604DashP6.NX07_G); // NXX_007 + cdc.add(FCDotCDC1604DashP6.NX15_O); // NXX_015 + cdc.add(FCDotCDC1604DashP6.NX04_D); // NXX_004 + cdc.add(FCDotCDC1604DashP6._SEMICOLON); + cdc.add(FCDotCDC1604DashP6.__LINE); - String out = FourCornerUnicodeDisplay.text().renderFromX06(cdc); - Assertions.assertEquals("X¹/₃", out); + Assertions.assertEquals("X=¹⁴/₁₅⁵/₁₅⁷/₁₅¹⁵/₁₅⁴/₁₅;\n", FourCornerUnicodeDisplay.text().renderFromX06(cdc)); + Assertions.assertEquals("X=␂ONEGOD;\n", FourCornerUnicodeDisplay.raw().renderFromX06(cdc)); } @Test public void testMixedCasing() throws Exception { List cdc = new ArrayList<>(); - - //cdc.add(FCDotCDC1604DashP6.__PIE); - //cdc.add(FCDotCDC1604DashP6.NX26_Z); // select lower case - //cdc.add(FCDotCDC1604DashP6.NX01_A); cdc.add(FCDotPIE9CDash26.LOW_A); cdc.add(FCDotPIE9CDash26.LOW_B); // if used as this per letter full escaping here.... - cdc.add(FCDotCDC1604DashP6.__SPACE); // out of range is end lower cdc.add(FCDotCDC1604DashP6.NX02_B); - - //cdc.add(FCDotCDC1604DashP6.__ESC6); cdc.add(FCDotDEC1604DashP7.__ESC_BELOW); // test escape code cdc.add(FCDotCDC1604DashP6.NX03_C); - cdc.add(FCDotCDC1604DashP6.NX04_D); // thus this upper case D cdc.add(FCDotCDC1604DashP6._DOT); cdc.add(FCDotCDC1604DashP6.__PIE); @@ -76,8 +75,6 @@ public class FourCornerUnicodeDisplayTest { cdc.add(FCDotCDC1604DashP6.NX11_K); cdc.add(FCDotCDC1604DashP6.NX12_L); cdc.add(FCDotCDC1604DashP6.NX13_M); - - //cdc.add(FCDotCDC1604DashP6.__ESC6); cdc.add(FCDotDEC1604DashP7.__ESC_STOP); cdc.add(FCDotCDC1604DashP6.NX15_O); @@ -96,8 +93,7 @@ public class FourCornerUnicodeDisplayTest { cdc.add(FCDotCDC1604DashP6._AT); cdc.add(FCDotCDC1604DashP6.NX11_K); // = K - String out = FourCornerUnicodeDisplay.text().renderFromX06(cdc); - Assertions.assertEquals("X^%@K", out); + Assertions.assertEquals("X^%@K", FourCornerUnicodeDisplay.text().renderFromX06(cdc)); } @Test @@ -111,7 +107,6 @@ public class FourCornerUnicodeDisplayTest { cdc.add(FCDotCDC1604DashP6.NX04_D); // 3 cdc.add(FCDotCDC1604DashP6.NX11_K); // K - String out = FourCornerUnicodeDisplay.text().renderFromX06(cdc); - Assertions.assertEquals("B3K", out); + Assertions.assertEquals("B3K", FourCornerUnicodeDisplay.text().renderFromX06(cdc)); } }