diff options
| author | MakKi (makki_d) <d.makiuchi+gh@gmail.com> | 2018-11-09 17:05:07 +0300 |
|---|---|---|
| committer | Sean Owen <srowen@gmail.com> | 2018-11-09 17:05:07 +0300 |
| commit | e636498b5e5b07bcfcdf27a3461ea3b5e127e418 (patch) | |
| tree | 91a8eb93f01f75bee8bea2f3fbb2da802c87da2c /core/src/test/java/com | |
| parent | b31e090239cf20793ba222d1bf3e61d9f4fb7a44 (diff) | |
| download | zxing-e636498b5e5b07bcfcdf27a3461ea3b5e127e418.tar.xz | |
Support Full-ASCII in Code93Writer (#1104)
* support extended characters in Code93Writer
* remove redundancy
* add test for convertToExtended
* thanks for review
* fix comment, use package-private for testing
Diffstat (limited to 'core/src/test/java/com')
| -rw-r--r-- | core/src/test/java/com/google/zxing/oned/Code93WriterTestCase.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/src/test/java/com/google/zxing/oned/Code93WriterTestCase.java b/core/src/test/java/com/google/zxing/oned/Code93WriterTestCase.java index baf007990..b9b9f672e 100644 --- a/core/src/test/java/com/google/zxing/oned/Code93WriterTestCase.java +++ b/core/src/test/java/com/google/zxing/oned/Code93WriterTestCase.java @@ -36,6 +36,22 @@ public final class Code93WriterTestCase extends Assert { "101100101101011001101001101100101101100110101011011001011001101001101101001110101000" + "101001010010001010001001010000101001010001001001001001000101010100001000100101000010" + "10100111010101000010101011110100000"); + + doTest("\u0000\u0001\u001a\u001b\u001f $%+!,09:;@AZ[_`az{\u007f", + "00000" + "101011110" + + "111011010" + "110010110" + "100100110" + "110101000" + // bU aA + "100100110" + "100111010" + "111011010" + "110101000" + // aZ bA + "111011010" + "110010010" + "111010010" + "111001010" + // bE space $ + "110101110" + "101110110" + "111010110" + "110101000" + // % + cA + "111010110" + "101011000" + "100010100" + "100001010" + // cL 0 9 + "111010110" + "100111010" + "111011010" + "110001010" + // cZ bF + "111011010" + "110011010" + "110101000" + "100111010" + // bV A Z + "111011010" + "100011010" + "111011010" + "100101100" + // bK bO + "111011010" + "101101100" + "100110010" + "110101000" + // bW dA + "100110010" + "100111010" + "111011010" + "100010110" + // dZ bP + "111011010" + "110100110" + // bT + "110100010" + "110101100" + // checksum: 12 28 + "101011110" + "100000"); } private static void doTest(String input, CharSequence expected) throws WriterException { @@ -43,4 +59,12 @@ public final class Code93WriterTestCase extends Assert { assertEquals(expected, BitMatrixTestCase.matrixToString(result)); } + @Test + public void testConvertToExtended() throws Exception { + // non-extended chars are not changed. + String src = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%"; + String dst = Code93Writer.convertToExtended(src); + assertEquals(src, dst); + } + } |
