Fixed terminator under range fire test
This commit is contained in:
parent
494556da06
commit
5d806130f2
|
@ -243,7 +243,12 @@ public enum CDC1604DashP6 {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
numberMode = cdc.next();
|
numberMode = cdc.next();
|
||||||
continue;
|
if (numberMode.ordinal() < CDC1604DashP6.NX01_A.ordinal()) {
|
||||||
|
cdcPoint = numberMode; // print char
|
||||||
|
numberMode = null; // illegal number mode
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (numberMode == null) {
|
if (numberMode == null) {
|
||||||
buf.appendCodePoint(cdcPoint.asciiByte());
|
buf.appendCodePoint(cdcPoint.asciiByte());
|
||||||
|
|
|
@ -99,6 +99,21 @@ public class CDC1604DashP6Test {
|
||||||
Assertions.assertEquals("01201337", out);
|
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
|
@Test
|
||||||
public void testNumberPieOutOfRange() throws Exception {
|
public void testNumberPieOutOfRange() throws Exception {
|
||||||
List<CDC1604DashP6> cdc = new ArrayList<>();
|
List<CDC1604DashP6> cdc = new ArrayList<>();
|
||||||
|
|
Loading…
Reference in a new issue