reinstate testEncodeAuto UT

This commit is contained in:
ftiercelin 2024-10-22 12:13:58 +01:00
parent b56cb8f7f0
commit 7b7ba826a2

View file

@ -35,6 +35,13 @@ import org.junit.Test;
* Tests {@link PDF417HighLevelEncoder}. * Tests {@link PDF417HighLevelEncoder}.
*/ */
public final class PDF417EncoderTestCase extends Assert { public final class PDF417EncoderTestCase extends Assert {
private static final String PDF417PFX = "\u039f\u001A\u0385";
@Test
public void testEncodeAuto() throws Exception {
String encoded = PDF417HighLevelEncoder.encodeHighLevel(
"ABCD", Compaction.AUTO, StandardCharsets.UTF_8, false);
assertEquals(PDF417PFX + "ABCD", encoded);
}
@Test @Test
public void testEncodeAutoWithSpecialChars() throws Exception { public void testEncodeAutoWithSpecialChars() throws Exception {
@ -98,8 +105,8 @@ public final class PDF417EncoderTestCase extends Assert {
} }
} }
public void checkEncodeAutoWithSpecialChars(String input, Compaction compaction) throws Exception { public String checkEncodeAutoWithSpecialChars(String input, Compaction compaction) throws Exception {
PDF417HighLevelEncoder.encodeHighLevel(input, compaction, StandardCharsets.UTF_8, false); return PDF417HighLevelEncoder.encodeHighLevel(input, compaction, StandardCharsets.UTF_8, false);
} }
@Test @Test