Skip to content

Commit 1540af5

Browse files
committed
Added alphabets
1 parent dabbb91 commit 1540af5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/test/java/com/mapcode/AlphabetTest.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,26 @@ public void convertGreek2() throws Exception {
6767
final Point p1 = MapcodeCodec.decode(a1);
6868
final String y1 = MapcodeCodec.encodeToShortest(p1).getMapcodePrecision(0);
6969
final String b1 = Mapcode.convertToAlphabet(y1, Alphabet.GREEK);
70-
final String d1 = Mapcode.convertToAlphabet(y1, Alphabet.ROMAN);
71-
LOG.info("a1 = {}, b1 = {}, c1 = {}, d1 = {}, y1 = {}, p1 = {}", a1, b1, d1, y1, p1);
70+
final String c1 = Mapcode.convertToAscii(b1);
71+
final String d1 = Mapcode.convertToAlphabet(b1, Alphabet.ROMAN);
72+
LOG.info("a1 = {}, b1 = {}, c1 = {}, d1 = {}, y1 = {}, p1 = {}", a1, b1, c1, d1, y1, p1);
7273
assertEquals(a1, y1);
74+
assertEquals(a1, c1);
7375
assertEquals(a1, d1);
76+
}
7477

78+
@Test
79+
public void convertGreek3() throws Exception {
80+
LOG.info("convertGreek3");
7581
final String a2 = "36228.92UW-TK";
7682
final Point p2 = MapcodeCodec.decode(a2);
7783
final String y2 = MapcodeCodec.encodeToShortest(p2).getMapcodePrecision(2);
7884
final String b2 = Mapcode.convertToAlphabet(y2, Alphabet.GREEK);
79-
final String c2 = Mapcode.convertToAlphabet(b2, Alphabet.ROMAN);
80-
LOG.info("a2 = {}, b2 = {}, c2 = {}, y2 = {}, p2 = {}", a2, b2, c2, y2, p2);
85+
final String c2 = Mapcode.convertToAscii(b2);
86+
final String d2 = Mapcode.convertToAlphabet(b2, Alphabet.ROMAN);
87+
LOG.info("a2 = {}, b2 = {}, c2 = {}, d2 = {}, y2 = {}, p2 = {}", a2, b2, c2, d2, y2, p2);
88+
assertEquals(a2, y2);
8189
assertEquals(a2, c2);
90+
assertEquals(a2, d2);
8291
}
8392
}

0 commit comments

Comments
 (0)