Fixed terminator under range fire test
This commit is contained in:
parent
494556da06
commit
5d806130f2
|
@ -243,8 +243,13 @@ public enum CDC1604DashP6 {
|
|||
break;
|
||||
}
|
||||
numberMode = cdc.next();
|
||||
if (numberMode.ordinal() < CDC1604DashP6.NX01_A.ordinal()) {
|
||||
cdcPoint = numberMode; // print char
|
||||
numberMode = null; // illegal number mode
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (numberMode == null) {
|
||||
buf.appendCodePoint(cdcPoint.asciiByte());
|
||||
} else {
|
||||
|
|
|
@ -99,6 +99,21 @@ public class CDC1604DashP6Test {
|
|||
Assertions.assertEquals("01201337", out);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberTerminatorOutOfRange() throws Exception {
|
||||
List<CDC1604DashP6> cdc = new ArrayList<>();
|
||||
cdc.add(CDC1604DashP6.NX24_X); // = X
|
||||
cdc.add(CDC1604DashP6.__PIE);
|
||||
cdc.add(CDC1604DashP6._CARET); // ^
|
||||
cdc.add(CDC1604DashP6._PERCENT); // = %
|
||||
cdc.add(CDC1604DashP6.__PIE);
|
||||
cdc.add(CDC1604DashP6._AT);
|
||||
cdc.add(CDC1604DashP6.NX11_K); // = K
|
||||
|
||||
String out = CDC1604DashP6.convertToUnicode(cdc);
|
||||
Assertions.assertEquals("X^%@K", out);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberPieOutOfRange() throws Exception {
|
||||
List<CDC1604DashP6> cdc = new ArrayList<>();
|
||||
|
|
Loading…
Reference in a new issue